public void SerilogLoggerSettings_RegisterSerilogLogLevel_Twice() { var loggerSettings = new SerilogLoggerSettings(_fileSystem, LogEventLevel.Debug, LoggingOutputFlags.Default); loggerSettings.RegisterLogLevel(LoggingOutputFlags.RollingFile, LogEventLevel.Error); loggerSettings.GetLogLevel(LoggingOutputFlags.RollingFile).InitialLogLevel.Should().Be(LogLevel.Error); loggerSettings.GetLogLevel(LoggingOutputFlags.RollingFile).MinimumLogLevel.Should().Be(LogLevel.Error); loggerSettings.RegisterLogLevel(LoggingOutputFlags.RollingFile, LogEventLevel.Debug); loggerSettings.GetLogLevel(LoggingOutputFlags.RollingFile).InitialLogLevel.Should().Be(LogLevel.Error); loggerSettings.GetLogLevel(LoggingOutputFlags.RollingFile).MinimumLogLevel.Should().Be(LogLevel.Debug); }
public void SerilogLoggerSettings_GetOrRegisterSerilogLogLevel_Overrides() { var loggerSettings = new SerilogLoggerSettings(_fileSystem, LogEventLevel.Debug, LoggingOutputFlags.Default); loggerSettings.RegisterSerilogLogLevel(LoggingOutputFlags.RollingFile, LogLevel.Debug).MinimumLogLevel.Should().Be(LogLevel.Debug); loggerSettings.RegisterSerilogLogLevel(LoggingOutputFlags.TestCorrelator, LogEventLevel.Debug).MinimumLogLevel.Should().Be(LogLevel.Debug); loggerSettings.RegisterLogLevel(LoggingOutputFlags.AppInsights, LogEventLevel.Debug).MinimumLogLevel.Should().Be(LogLevel.Debug); loggerSettings.RegisterLogLevel(LoggingOutputFlags.Console, LogLevel.Debug).MinimumLogLevel.Should().Be(LogLevel.Debug); loggerSettings.GetOrRegisterSerilogLogLevel(LoggingOutputFlags.RollingFile, LogLevel.Debug).MinimumLogLevel.Should().Be(LogLevel.Debug); loggerSettings.GetOrRegisterLogLevel(LoggingOutputFlags.AppInsights, LogLevel.Debug).MinimumLogLevel.Should().Be(LogLevel.Debug); loggerSettings.GetSerilogLogLevel(LoggingOutputFlags.AppInsights).MinimumLogLevel.Should().Be(LogLevel.Debug); }
public void SerilogLoggerSettings_GetOrRegisterLogLevel_Twice() { var loggerSettings = new SerilogLoggerSettings(_fileSystem, LogEventLevel.Debug, LoggingOutputFlags.Default); const string testLogLevel = "TestLogLevel"; loggerSettings.RegisterLogLevel(testLogLevel, LogLevel.Error); loggerSettings.GetLogLevel(testLogLevel).InitialLogLevel.Should().Be(LogLevel.Error); loggerSettings.GetLogLevel(testLogLevel).MinimumLogLevel.Should().Be(LogLevel.Error); loggerSettings.GetOrRegisterLogLevel(testLogLevel, LogLevel.Debug); loggerSettings.GetLogLevel(testLogLevel).InitialLogLevel.Should().Be(LogLevel.Error); // Does Not reset MinimumLogLevel to Debug as testLogLevel already exists loggerSettings.GetLogLevel(testLogLevel).MinimumLogLevel.Should().Be(LogLevel.Error); }