-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TC.Active is obsolete and we should re-think its use in logging adapters #1457
Comments
Hello |
@mia01 For logging adaptors other than Ilogger, I believe your only option would be to continue using TC.Active, even though its obsolete. |
@cijothomas I've only noticed this with console apps. With web apps I've been able to use:
Do you know why this is the case? |
For console app, https://docs.microsoft.com/en-us/azure/azure-monitor/app/worker-service this is the recommended approach. And initializers can be added the same way as web. It only integrates well with ilogger based logging, so nlog would require some manual steps. |
@cijothomas Thanks for responding to my comment. Just doing some more investigation I could see there is a difference between the TelemetryConfigurationOptions class for ASP and TelemetryConfigurationOptions for workerservice you'll find the ASP one has a fallback mechanism where it adds all the initialisers to |
Populating WorkerServiceSDK is a totally new package, and it never had Unfortunately - I don't have any better solution than using .ACTIVE for .net core console apps integration with NLog. |
This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. |
NLog 5.0 makes it possible to resolve service-dependencies, so one can acquire the Telemetry-interface from the ServiceProvider. It would ofcourse require bumping |
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. |
TelemetryConfiguration.Active
is now obsolete for .NET Core target.Several of logging adapters rely on TC.Active to get the currently used and/or modified configuration from the main SDK installation. At the same time, these projects are multi-targeted to compile for .NET Core and .NET Full.
This approach works for .NET Full but not for .NET Core where TC.Active is not the one in use.
This is not a regression - adapters have used TC.Active from the beginning, but the issue was highlighted by obsoleting TC.Active.
The text was updated successfully, but these errors were encountered: