Skip to content

Change LogLevel in runtime for single request #88599

@niuzheng168

Description

@niuzheng168

Is there an existing issue for this?

  • I have searched the existing issues

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions