-
Notifications
You must be signed in to change notification settings - Fork 148
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
LoggingLevelSwitch support #454
Comments
Hi @raV720! Thank you for writing us. The log level setting is not managed by this sink but can be controlled by Microsoft.Extension.Logging or by Serilog.Extension.Logging respectively. It should be able to update the log level property depending on the source of the setting (appsettings). Further reading: |
So according to https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#change-log-levels-in-a-running-app it is not possible to change log level at runtime unless modifying appsetting.json? Isn't it just matter of adding levelSwitch parameter in line: Line 131 in 216330e
|
The code you are referring to is only called once during initialization of the logger. It cannot be called again later during runtime of your app. |
Yes, but if I understand correctly: passed levelSwitch can be used later during runtime to change log level. |
Ah, got ya! I will look into that. |
We just released the preview version 6.2.0-dev-00041 to nuget.org which features a way to pass a LevelSwitch via the sink options object. Please try it out and let us know if you find any problems. |
Does this sink support runtime changes of LogEventLevel? If not then it would be really helpful to implement such option.
The text was updated successfully, but these errors were encountered: