Closed gkinsman closed 2 days ago
Thanks for the note, @gkinsman! Sorry about the slow reply - just got back from a short vacation :-)
I might need a bit more context around what your test code looks like, I'm not sure I can really wrap my head around the scenario.
Just to try to fill in the picture - if you have an ILogger
already in hand, could you (for example) try casting it to ReloadableLogger
and call Reload
yourself, before passing it through to AddSerilog
?
Closing this one as stale, hope you were able to figure out a solution.
Hi there!
I'm kicking the tyres on
CreateBootstrapLogger
so that we can pull our log sink config from a secure store. To support parallel test running we don't use a static logger and instead inject it, but I don't see an override ofUseSerilog
/AddSerilog
that accepts both anILogger
and a reconfiguration callback.This code appears to only check to see if the static logger exists - should there perhaps be an overload that just accepts an ILogger and checks if it or the static logger is reloadable? Happy to add it if this is the right way to go :)
https://github.com/serilog/serilog-extensions-hosting/blob/52f29a676444e58015863ab92c1432357d0fa03f/src/Serilog.Extensions.Hosting/SerilogServiceCollectionExtensions.cs#L141-L144