serilog-sinks-browserhttp icon indicating copy to clipboard operation
serilog-sinks-browserhttp copied to clipboard

Disposing the sink fails in the browser with `PlatformNotSupportedException`

Open nblumhardt opened this issue 3 years ago • 0 comments

E.g. when calling Log.CloseAndFlush():

at System.Threading.Tasks.Task.Wait()
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.ResetSyncContextAndWait(Func`1 taskFactory)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.CloseAndFlush()
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.Dispose(Boolean disposing)
at Serilog.Sinks.BrowserHttp.BrowserHttpSink.Dispose(Boolean disposing)
at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.Dispose()

It's likely this will require specific support in PeriodicBatchingSink, but in the short term it may be better to grab the code from there, embed it in this library, and tweak until we're happy.

nblumhardt avatar May 25 '21 22:05 nblumhardt