예제 #1
0
        public CommonTests()
        {
            _testSink = new TestSink();
            var logger = new LoggerConfiguration().AddMiniProfiler().WriteTo.Sink(_testSink).MinimumLevel.Debug().CreateLogger();

            MiniProfilerLog.SetUpSerilog(logger);
        }
예제 #2
0
        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);
        }
예제 #3
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();
        }