serilog-extensions-logging-file
serilog-extensions-logging-file copied to clipboard
Configuration change token support
Hi, It seems that the change token handling isn't implemented in this extension. At least I couldn't find it in code and I found it while playing with it and changing configuration but nothing happend ;)
Is this something you are going to add? thanks M
Hi Micha- thanks for the note. It seems like this would be a worthwhile addition, but there's no work in progress on it currently.
+1
Not a lot of context to this old open issue. Willing to work on it but need a few more specifics.
Hi @SixtoSaez - thanks for jumping in. https://docs.microsoft.com/en-us/aspnet/core/fundamentals/change-tokens?view=aspnetcore-3.1 is what the OP is referring to. Shimming it in here will require some kind of sink wrapper that's capable of switching out file sinks under the hood in response to configuration changes - a proof of concept might use Serilog.Sinks.Map with an open sink limit of 1 to achieve this. Hope this helps!
Yes it does! I'll get up to date on the change tokens and the code you suggested.