Skip to content

README explanation #202

Open
Open
@lucashby

Description

@lucashby

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions