Exemple #1
0
//        [InlineData(LogLevel.None)]
        public void SerilogLoggerSettings_Create_Default_LogLevels(LogLevel logLevel)
        {
            var loggerSettings = new SerilogLoggerSettings(_fileSystem, logLevel, LoggingOutputFlags.Default);

            loggerSettings.LoggingOutputFlags.Should().Be(LoggingOutputFlags.Default);

            // Serilog LogEventLevels
            loggerSettings.GetSerilogLogLevel(LoggingOutputFlags.Default).MinimumLogEventLevel.Should()
            .Be(SerilogLogLevel.MsftToSerilogLogLevel(logLevel));
            loggerSettings.GetSerilogLogLevel(LoggingOutputFlags.Default).InitialLogEventLevel.Should()
            .Be(SerilogLogLevel.MsftToSerilogLogLevel(logLevel));

            // Msft LogLevels
            loggerSettings.GetLogLevel(LoggingOutputFlags.Default).MinimumLogLevel.Should().Be(logLevel);
            loggerSettings.GetLogLevel(LoggingOutputFlags.Default).InitialLogLevel.Should().Be(logLevel);
        }
Exemple #2
0
        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);
        }