private void CreateSerilog(DiagnosticPipeline diagnosticPipeline)
        {
            var option = Context.GetOption <DiagnosticsOption>("Diagnostics");

            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Is(option.SerilogEventLevel)
                         .WriteTo.Debug()
                         .WriteTo.EventFlow(diagnosticPipeline)
                         .CreateLogger();
        }
        private void CreateSerilog(DiagnosticPipeline diagnosticPipeline)
        {
            var option = diagnosticPipeline == null
                ? new DiagnosticsOption {
                SerilogEventLevel = Serilog.Events.LogEventLevel.Debug
            }
                : Context.GetOption <DiagnosticsOption>("Diagnostics");

            var logConfig = new LoggerConfiguration()
                            .MinimumLevel.Is(option.SerilogEventLevel)
                            .WriteTo.Debug();

            if (diagnosticPipeline != null)
            {
                logConfig.WriteTo.EventFlow(diagnosticPipeline);
            }
            Log.Logger = logConfig.CreateLogger();
        }