Skip to content

How to set ConnectionString using ILogger? #1944

@TimothyMothra

Description

@TimothyMothra

We have an internal customer using ILogger, and they need to set the ConnectionString but it appears that we don't expose that in the ILogger SDK.

We have a constructor overload that would permit this, but it's currently set to private.

/// <summary>
/// Adds an ApplicationInsights logger named 'ApplicationInsights' to the factory.
/// </summary>
/// <param name="builder">The <see cref="ILoggingBuilder"/> to use.</param>
/// <param name="configureTelemetryConfiguration">Action to configure telemetry configuration.</param>
/// <param name="configureApplicationInsightsLoggerOptions">Action to configure ApplicationInsights logger.</param>
private static ILoggingBuilder AddApplicationInsights(
this ILoggingBuilder builder,
Action<TelemetryConfiguration> configureTelemetryConfiguration,
Action<ApplicationInsightsLoggerOptions> configureApplicationInsightsLoggerOptions)
{

I propose we set this to public to unblock this customer.

@cijothomas do you know of any workarounds?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions