serilog-extensions-logging-file icon indicating copy to clipboard operation
serilog-extensions-logging-file copied to clipboard

Configuration change token support

Open MichaCo opened this issue 9 years ago • 5 comments

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

MichaCo avatar Nov 29 '16 16:11 MichaCo

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.

nblumhardt avatar Nov 29 '16 21:11 nblumhardt

+1

szahn avatar Dec 12 '17 02:12 szahn

Not a lot of context to this old open issue. Willing to work on it but need a few more specifics.

SixtoSaez avatar Aug 04 '20 21:08 SixtoSaez

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!

nblumhardt avatar Aug 04 '20 22:08 nblumhardt

Yes it does! I'll get up to date on the change tokens and the code you suggested.

SixtoSaez avatar Aug 05 '20 16:08 SixtoSaez