public void Scrape() { var formatter = new Serilog.Formatting.Json.JsonFormatter(); Log.Logger = new LoggerConfiguration().MinimumLevel.Debug().MinimumLevel.Override("Microsoft", Serilog.Events.LogEventLevel.Information).Enrich.FromLogContext().WriteTo.Console().CreateLogger(); timer.Interval = 1000; //1 second timer.Elapsed += Timer_Elapsed; timer.Start(); isRunning = true; var random = new Random(); while (isRunning) { Thread.Sleep(random.Next(10000)); //keeps app alive } }
public MariaContext() { var formatter = new Serilog.Formatting.Json.JsonFormatter(); Log.Logger = new LoggerConfiguration().MinimumLevel.Debug().MinimumLevel.Override("Microsoft", Serilog.Events.LogEventLevel.Information).Enrich.FromLogContext().WriteTo.Console().CreateLogger(); }