Skip to content

Flush the TelemetryChannel when the logger provider is disposed#1289

Merged
TimothyMothra merged 5 commits intomicrosoft:developfrom
pharring:dev/pharring/ILoggerFlushTelemetryChannelOnDispose
Nov 14, 2019
Merged

Flush the TelemetryChannel when the logger provider is disposed#1289
TimothyMothra merged 5 commits intomicrosoft:developfrom
pharring:dev/pharring/ILoggerFlushTelemetryChannelOnDispose

Conversation

@pharring
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

/AzurePipelines run

1 similar comment
@TimothyMothra
Copy link
Copy Markdown

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

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