Closed catcake closed 3 years ago
Hello @catcake - thanks for the note.
Do you mean that the output of this statement is missing?
_log.Warning("Seq sink disabled: required parameter empty");
I.e. are logs working again once UseSerilog()
has returned?
I think this may be a side-effect of the current design; in ReloadableLogger
, the initial pipeline is disposed before the new one is configured:
(This avoids problems where an existing sink might exclusively lock some shared resource.)
Yes, that is the missing statement and yes, everything works flawlessly once UseSerilog()
has returned. Thank your for the feedback!
Hello!
So, I configure
Log.Logger
initially inMain()
and this works up until and then after, but not inside ofUseSerilog(IHostBuilder, Action<HostBuilderContext, IServiceProvider, LoggerConfiguration>, bool, bool)
. I think it has to do with the previous sinks not being flushed before the new configuration is applied because when using theConsole
andFile
sinks without theAsync
sink, theConsole
sink outputs as expected, yet theFile
sink still does not. I am referring to log inside theif
statement withinUseSerilog()
(and the regularWriteLine()
does print).The output appears in both desired sinks when
preserveStaticLogger
is set totrue
, but this isn't an ideal solution because the logs for the File sink are split across two separate files.I'm not sure if this is something that simply not supported, a problem on my part, or a bug in
UseSerilog()
.Here's my Program.cs file, as most of it is relevant:
Thank you!