-
Notifications
You must be signed in to change notification settings - Fork 850
Closed
Labels
enhancementNew feature or requestNew feature or requestlogsLogging signal relatedLogging signal related
Description
Feature Request
Is your feature request related to a problem?
- Today Logging extensions provide
AddOpenTelemetryextension onILoggingBuilder, howeverAddProcessorandSetResourceProviderextensions are exposed onOpenTelemetryLoggerOptions. This is restrictive for services which are primarily using DI. Exposing these extensions onOpenTelemetryLoggerOptionsand not onILoggingBuilderand/orIServiceCollectionlimits the ability for third party libraries to provide easier capabilities for adding processor for example, or to compose the resource provider from resources exposed by multiple third party libraries etc. With the DI based mechanism a processor can then be added which can get access to other objects via DI injection and making the APIs really DI friendly for users - Another ask here is to also expose an override for the existing
AddOpenTelemetryextension to take in options via
Describe the solution you'd like:
Expose the extensions SetResourceProvider and AddProcessor on ILoggingBuilder.
public static ILoggingBuilder AddProcessor<T>(this ILoggingBuilder builder)
where T : BaseProcessor<LogRecord>{}
public static ILoggingBuilder SetResourceBuilder(this ILoggingBuilder loggingBuilder, ResourceBuilder resourceBuilder);Add another overload for AddOpenTelemetry extension
public static ILoggingBuilder AddOpenTelemetry(this ILoggingBuilder builder, IConfigurationSection configurationSection) {}Describe alternatives you've considered.
Currently we had to implement custom LoggerProvider to get the right functionality
Additional Context
We would like to move to directly using OpenTelemetryLogger and extending it as opposed to having our own implementation of LoggerProvider and Logger.
goldsam and splitt3r
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestlogsLogging signal relatedLogging signal related