[hosting-logs] Don't register ILogger when calling WithLogging (#4535)

This commit is contained in:
Mikel Blanchard 2023-06-01 12:27:38 -07:00 committed by GitHub
parent ccfbcc62d1
commit 9b5c483651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 12 deletions

View File

@ -15,7 +15,6 @@
// </copyright>
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using OpenTelemetry.Internal;
using OpenTelemetry.Logs;
using OpenTelemetry.Metrics;
@ -141,15 +140,9 @@ public sealed class OpenTelemetryBuilder
/// Adds logging services into the builder.
/// </summary>
/// <remarks>
/// Notes:
/// <list type="bullet">
/// <item>This is safe to be called multiple times and by library authors.
/// Note: This is safe to be called multiple times and by library authors.
/// Only a single <see cref="LoggerProvider"/> will be created for a given
/// <see cref="IServiceCollection"/>.</item>
/// <item>This operation enables <see cref="ILogger"/> integration
/// automatically by calling <see
/// cref="OpenTelemetryLoggingExtensions.AddOpenTelemetry(ILoggingBuilder)"/>.</item>
/// </list>
/// <see cref="IServiceCollection"/>.
/// </remarks>
/// <returns>The supplied <see cref="OpenTelemetryBuilder"/> for chaining
/// calls.</returns>
@ -168,9 +161,6 @@ public sealed class OpenTelemetryBuilder
{
Guard.ThrowIfNull(configure);
// Note: This enables ILogger integration
this.Services.AddLogging().AddOpenTelemetry();
var builder = new LoggerProviderBuilderBase(this.Services);
configure(builder);