Skip to content

CloseAndFlushAsync doesn't work with ReloadableLogger #2115

@VavilovAlex

Description

@VavilovAlex

Description
Calling Log.CloseAndFlushAsync() when using ReloadableLogger as a static logger silently fails and does nothing.

Reproduction

  1. Set the static logger to a ReloadableLogger.
  2. Call Log.CloseAndFlushAsync().

Expected behavior
The ReloadableLogger should either:

  • Support DisposeAsync() and properly flush the sinks
  • Fall back to Dispose() if DisposeAsync() is not available,
  • Throw an exception indicating the failure to close and flush.

Relevant package, tooling and runtime versions
Serilog 4.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions