-
Notifications
You must be signed in to change notification settings - Fork 664
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
DRAFT: Add configuration of log level and formatting for Auto Instrumentation #4203
base: main
Are you sure you want to change the base?
Conversation
4b0e27a
to
a0b79f8
Compare
a0b79f8
to
e641e75
Compare
levels = { | ||
"debug": logging.DEBUG, | ||
"info": logging.INFO, | ||
"warning": logging.WARNING, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add warn
According to the specification, The logging config should only apply to the |
logging.getLogger().addHandler(handler) | ||
logging.basicConfig( | ||
format=log_format, | ||
level=log_level, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have the side effect of applying to all loggers without custom levels. The root here should be logging.NOSET
and afterwards add logging.getLogger('opentelemetry').setLevel(log_level)
to allow the OTEL_LOG_LEVEL
to only apply to the SDK and instrumentors and exporters.
Description
DRAFT: Proposal for adding configuration of log level and formatting for Auto Instrumentation. Main subject to decide on is which env vars to use:
OTEL_LOG_LEVEL: Exists in the SDK but unused
OTEL_PYTHON_LOG_LEVEL: Currently only used by Python Logging Instrumentation
OTEL_PYTHON_LOG_FORMAT: Currently only used by Python Logging Instrumentation
Fixes #4034
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Contrib Repo Change?
Checklist: