private static void CreateSerilogLogger(WebHostBuilderContext builderContext, LoggerConfiguration config) { var configuration = ConfigureBuilder.GetConfiguration(builderContext.HostingEnvironment); var instrumentationKey = configuration.GetValue <string>("ApplicationInsights:InstrumentationKey"); config .ReadFrom.Configuration(configuration) .WriteTo.ApplicationInsights(instrumentationKey, TelemetryConverter.Events, Serilog.Events.LogEventLevel.Information) .WriteTo.ApplicationInsights(instrumentationKey, TelemetryConverter.Traces, Serilog.Events.LogEventLevel.Information) ; }
public Startup(IHostEnvironment env) { Configuration = ConfigureBuilder.GetConfiguration(env); this._env = env; }