How to set experimental log options programatically #5082
megla-tlanghorst
started this conversation in
General
Replies: 1 comment 2 replies
-
@megla-tlanghorst Experimental options can be set from IConfig. Note that this feature was recently added and is not yet available, it is expected to be released with 1.7.0 preview version in a week or so. As an e.g. using var loggerFactory = LoggerFactory.Create(builder =>
{
builder.Services.AddSingleton<IConfiguration>(config);
builder.AddOpenTelemetry(logging => logging.AddOtlpExporter());
}); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using OTLP logging currently and it's working really good so far, but we also want to include exceptions and stacktraces into the logs. I've seen there's support for that now, but it's gated behind
ExperimentalOptions.EmitLogExceptionAttributes
which can be set by environment variable, but I need to set it programmatically, because we control these options from a central spot programatically.So far the only viable thing I see there would be to set it from within the process:
Is there any other way to set it from the dependency injection?
For the normal options for example we use something like this:
Beta Was this translation helpful? Give feedback.
All reactions