Skip to content

Support Dynamically Changing Log Level During RuntimeΒ #3647

@jasonmfehr

Description

@jasonmfehr

Problem Statement
Our app supports changing the logging level dynamically at runtime (without requiring a restart). We want to extend this functionality to also dynamically set the SDK's log level without needing to re-create any Providers. However, this functionality is not supported based on the comments in global_log_handler.h.

Describe the solution you'd like
When our app calls GlobalLogHandler::SetLogLevel, we would like the SDK to change it's logging level without needing to recreate and Providers.

Describe alternatives you've considered
We considered recreating providers when the log level changes but do not want to have the overhead of doing that in a large, multi-threaded application. We also tried changing the log level by calling GlobalLogHandler::SetLogLevel but found that changing from Debug to Info works (the debug messages no longer appear), but changing from Info to Debug only partially works (debug messages for "OTLP TRACE HTTP Exporter" appear but debug messages for "OTLP HTTP Client" do not appear).

Additional context
Add any other context about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions