-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Change LogLevel in runtime for single request #88599
Comments
Why not log a separate entry (i.e. with level Info or Warning) when |
Related: |
This sounds a just workaround. I'd like reuse same logger but just a log level change. |
Tagging subscribers to this area: @dotnet/area-extensions-logging Issue DetailsIs there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.I'd like to change log level in runtime for a single request. And in runtime, I will create a logger with LogLevel = Debug, and very thing will be logged. Change the log level in environment variable or appsettings.json will impact other queries, but we are not allowed to touch any customer data. Describe the solution you'd likeI'd like to have an overload method with additional parameter in ILoggerFactory.CreateLogger(LogLevel loglevel) Additional contextNo response
|
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I'd like to change log level in runtime for a single request.
My scenario is when customer report a bug that can only repro in PROD, they can send a request with additional parameter debug=1 like
https://mywebservice.com/request?para1=value1&debug=1
And in runtime, I will create a logger with LogLevel = Debug, and very thing will be logged.
Change the log level in environment variable or appsettings.json will impact other queries, but we are not allowed to touch any customer data.
Describe the solution you'd like
I'd like to have an overload method with additional parameter in ILoggerFactory.CreateLogger(LogLevel loglevel)
Additional context
No response
The text was updated successfully, but these errors were encountered: