Skip to content

Fall back to IDisposable in Log.CloseAndFlushAsync() when the target logger is not IAsyncDisposable#2116

Merged
nblumhardt merged 3 commits into
serilog:devfrom
nblumhardt:close-and-flush-async-uses-dispose
Sep 27, 2024
Merged

Fall back to IDisposable in Log.CloseAndFlushAsync() when the target logger is not IAsyncDisposable#2116
nblumhardt merged 3 commits into
serilog:devfrom
nblumhardt:close-and-flush-async-uses-dispose

Conversation

@nblumhardt

Copy link
Copy Markdown
Member

This fixes #2115.

We've missed spotting this previously because the default Logger type is IAsyncDisposable, and handles the fallback to IDisposable for sinks that don't implement it.

@nblumhardt
nblumhardt merged commit 3aa295b into serilog:dev Sep 27, 2024
@nblumhardt nblumhardt mentioned this pull request Sep 27, 2024
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.

CloseAndFlushAsync doesn't work with ReloadableLogger

1 participant