-
Notifications
You must be signed in to change notification settings - Fork 2.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
Support logging level config of handler through configure_azure_monitor
#36395
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @gracewilcox @gulopesd @Haiying-MSFT @jairmyree @joshfree @KarishmaGhiya @KevinBlasko @kurtzeborn @nisha-bhatia @pvaneck @sarangan12 @scottaddie @srnagar @ToddKingMSFT. |
This scenario makes sense. A solution via environment variable in upstream OpenTelemetry Python would be able to enable this scenario and allow you to configure log level of the OpenTelemetry As a side note, you must also change your code to pass in the namespace of the parent logger you want to use, not the variable name of the logger. ...
app_logger = logging.getLogger("App")
configure_azure_monitor(connection_string="", logger_name="App")
... |
Hi @yli02. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
Hi @yli02, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
Hi, sorry for the delay in replying, I was actually not sure what other actions I should perform if this is a valid request but could not be supported at the moment. |
This issue would have to be implemented for this feature to be enabled. |
@lzchen thanks for the info. |
Is your feature request related to a problem? Please describe.
The current logging configuration in [1] does not support to set the logging level for handler in [2], and this prevents to separate the logging to Azure and local in different levels based on logger hierarchy. For example
In the application, we would like to always use logger "app_logger_local" for different level of loggings to
stdout
andstderr
, and relying on logging hierarchy to pass logs to "app_logger". And we only would like to use Azure AppInsights to collect log with levelERROR
or higher.But this design is so far not feasible, as there is no checking of parent logger level at [3], see also [4].
Describe the solution you'd like
It would be great if a new argument could be added to [1], like
logging_level
to setup the logging level of the handler in [2], so we could rely on the above example code to collect loggings in different levels at different destination.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
[1]
azure-sdk-for-python/sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_configure.py
Line 68 in 0673cc0
[2]
azure-sdk-for-python/sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_configure.py
Line 163 in 0673cc0
[3] https://github.com/python/cpython/blob/15d48aea02099ffc5bdc5511cc53ced460cb31b9/Lib/logging/__init__.py#L1715
[4] python/cpython#75045 (comment)
The text was updated successfully, but these errors were encountered: