You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe your suggestion
Perhaps the README that has been updated could clarify something for everyone (especially me). The section that eludes me is here,
The README mentions creating the logger after services.AddApplicationInsightsTelemetry() is called, like so:
Log.Logger = new LoggerConfiguration()
.WriteTo.ApplicationInsights(
serviceProvider.GetRequiredService<TelemetryConfiguration>(),
TelemetryConverter.Traces)
.CreateLogger();
Unfortunately, I can not figure out where the example is getting 'serviceProvider', which I'm assuming is an IServiceProvider, but would not be available with 'services.AddLogging()' where one would normally set up the logger in a ConfigureServices() scenario.
Another possibility might be to throw in an 'examples' directory for a web application and a non-http application (worker service, console, etc.).
Describe alternatives you've considered
I haven't considered alternatives because I wish to set up app insights logging for serilog for ASPNETCore web application.
The text was updated successfully, but these errors were encountered:
The README needs some work now that 4.0 is out, and TelemetryConfiguration.Active is well and truly in the rear-view mirror. Some help would be appreciated if anyone can bite this off.
I read that part as being necessary only if you wished to have the bootstrap logger. It appears you are correct and I am getting my application insights logs after switching to UseSerilog(). Thank you for that.
Describe your suggestion
Perhaps the README that has been updated could clarify something for everyone (especially me). The section that eludes me is here,
The README mentions creating the logger after services.AddApplicationInsightsTelemetry() is called, like so:
Unfortunately, I can not figure out where the example is getting 'serviceProvider', which I'm assuming is an IServiceProvider, but would not be available with 'services.AddLogging()' where one would normally set up the logger in a ConfigureServices() scenario.
Another possibility might be to throw in an 'examples' directory for a web application and a non-http application (worker service, console, etc.).
Describe alternatives you've considered
I haven't considered alternatives because I wish to set up app insights logging for serilog for ASPNETCore web application.
The text was updated successfully, but these errors were encountered: