Open erichiller opened 6 days ago
Hi @erichiller, thanks for the note!
If not possible or too difficult of the above, perhaps render the failed log event(s) in SelfLogFailureListener.OnLoggingFailed() rather than only listing the quantity.
This is what WriteTo.Fallible()
enables - you can pass your own implementation of ILoggingFailureListener
and write out the included events or try buffering them to pick up and write through another sink later.
Reload()
shouldn't be causing events to reach a disposed sink, unless the thing writing the events is part of the logging infrastructure itself. This could be something to do with your configuration - if you're able to post the code we might be able to spot it.
Hope this helps, Nick
This commit changing line 53 in
BackgroundWorkerSink.cs
made it so that these errors were visible to me for the first time.This occurs because I am logging to something being called by
configure(new LoggerConfiguration()).CreateLogger();
inReloadableLogger
, which happens right after_logger.Dispose();
inReload()
.As you mentioned in this comment there may be some issues with locks, etc in changing the order of the
Dispose
andconfigure()
calls.One idea I had was rather than disposing regardless of changes,
Reload()
(or the code it calls) could check if the underlying loggers are equivalent during configuration (perhaps by implementingIEquatable<T>
), and if they are move the old logger to the new logger rather than re-create, and onlyDispose()
of the old logger if they are different?If not possible or too difficult of the above, perhaps render the failed log event(s) in
SelfLogFailureListener.OnLoggingFailed()
rather than only listing the quantity.