Skip to content
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

Flush the TelemetryChannel when the logger provider is disposed #1289

Conversation

pharring
Copy link
Member

@pharring pharring commented Nov 6, 2019

Automatically flush the telemetry channel when the ApplicationInsightsLoggerProvider is disposed.
This usually happens when the application calls Dispose on the ServiceProvider -- it calls Dispose on all IDisposable services that were instantiated.

This helps with Console applications that use ILogger which otherwise lose events sent just before shutdown. This works well for the InMemoryChannel but there is a long-standing issue with the ServerTelemetryChannel where Flush doesn't guarantee that all events have been transmitted. There's a TODO in the code about that.

Copy link
Contributor

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add to changelog as well? https://github.com/microsoft/ApplicationInsights-dotnet/blob/develop/LOGGING/CHANGELOG.md
@TimothyMothra we will soon merge all changelog into a common one, right?

@TimothyMothra
Copy link
Member

/AzurePipelines run

1 similar comment
@TimothyMothra
Copy link
Member

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TimothyMothra TimothyMothra merged commit 8e83183 into microsoft:develop Nov 14, 2019
@pharring pharring deleted the dev/pharring/ILoggerFlushTelemetryChannelOnDispose branch January 28, 2020 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants