private static void GenerateLogs(ILogger logger, ISerilogConfiguration serilogConfig)
        {
            Print("Default settings");
            GenerateLogs(logger);

            Print($"Changing default og level to {LogEventLevel.Error}");
            serilogConfig.SetLevel(LogEventLevel.Error);
            GenerateLogs(logger);

            Print($"Changing log level of category=Thinktecture to {LogEventLevel.Fatal}");
            serilogConfig.SetLevel(LogEventLevel.Fatal, "Thinktecture");
            GenerateLogs(logger);

            Print("Resetting all settings, returning to defaults");
            serilogConfig.ResetLevel();
            GenerateLogs(logger);
        }
Beispiel #2
0
 /// <summary>
 /// Initialise the logger
 /// </summary>
 /// <param name="serilogConfig"></param>
 /// <returns></returns>
 private static ILogger InitialiseLogger(ISerilogConfiguration serilogConfig)
 {
     return(serilogConfig.InitialiseLogger());
 }