public CommonTests() { _testSink = new TestSink(); var logger = new LoggerConfiguration().AddMiniProfiler().WriteTo.Sink(_testSink).MinimumLevel.Debug().CreateLogger(); MiniProfilerLog.SetUpSerilog(logger); }
public void LogLevelIsInfo_ProfileByDebug_ZeroLogEventsSendsToSink() { var logger = new LoggerConfiguration().AddMiniProfiler().WriteTo.Sink(_testSink).MinimumLevel.Information().CreateLogger(); MiniProfilerLog.SetUpSerilog(logger, LogEventLevel.Debug); StartOneStep(); _testSink.LogEvents.Should().HaveCount(0); }
static void Main(string[] args) { Log.Logger = new LoggerConfiguration() .AddMiniProfiler() .MinimumLevel.Verbose() .WriteTo.Seq("http://localhost:5341/") .WriteTo.RollingFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs\\log-{Date}.txt")) .CreateLogger(); MiniProfilerLog.SetUpSerilog(); MiniProfiler.Start(); MiniProfiler.StepStatic("SomeStep"); MiniProfiler.Stop(); Log.Logger.Debug("Some"); Log.CloseAndFlush(); }