Skip to content

WithLogging() ?? #4653

Answered by aygalinc
rmsimpson asked this question in Q&A
Jul 13, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Logging with OTEL is not configured the same way as metrics or trace.
Probably due to the fact that logging was existing in many Framework before Otel exist.
So in asp.net they hook the configuration like this :
public static IServiceCollection ConfigureOtelLogging(this IServiceCollection services) =>

    services.AddLogging(
        it =>
        {
            it.ClearProviders();
            it
                .AddOpenTelemetry(
                    options =>
                        options.AddConsoleExporter()
                            .IncludeScopes = true);
        });

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lvde0
Comment options

@vishweshbankwar
Comment options

Answer selected by cijothomas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants