Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch the config file at runtime #44

Open
chucklu opened this issue Jul 9, 2020 · 3 comments
Open

Watch the config file at runtime #44

chucklu opened this issue Jul 9, 2020 · 3 comments

Comments

@chucklu
Copy link

chucklu commented Jul 9, 2020

Try to figure out the feature about watch the App.config at runtime like log4net and NLog
https://stackoverflow.com/questions/25477415/how-can-i-reconfigure-serilog-without-restarting-the-application
https://stackoverflow.com/questions/50715913/serilog-equivalent-to-log4net-config-watch
The above two links have no useful info about reload all settings in App.config.

Here is another link https://stackoverflow.com/questions/53449596/reload-serilog-json-configuration-on-changes-in-net-core-2-1/60474967#60474967
The current Serilog implementation (2.9.0) is such that it is unable to fully reload settings. To work around this issue without introducing additional dependencies, avoid creating static loggers and follow the example provided here: https://github.com/akovac35/Logging/blob/v1.0.4/src/com.github.akovac35.Logging.Serilog/SerilogHelper.cs

Will you consider to implement this feature?

@nblumhardt
Copy link
Member

@bddckr
Copy link

bddckr commented Jul 14, 2020

Oh I wasn't aware of that repo yet! I am using tagcode/serilog-settings-reloader currently (with great success). Any two cents on the difference and general state of yours, Nick?

@nblumhardt
Copy link
Member

Hi Christopher-Marcel; the aim currently is to get as close to zero-overhead as possible once the logger is "frozen" - mapping closely to how the ASP.NET Core framework is first bootstrapped, and then given a final logger configuration that does not change. I think Serilog.Settings.Reloader is currently more general, and is undoubtedly a bit more mature :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants