Add logging_format configuration option in api#40057
Merged
lzchen merged 9 commits intoAzure:mainfrom Mar 26, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new "logging_format" configuration option to the API for customizing log formatting, updates the logging setup accordingly, and includes tests and sample usage changes.
- Added a new LOGGING_FORMAT_ARG constant and default configuration logic
- Updated _setup_logging to handle the logging_format option
- Modified tests and samples to verify and demonstrate the new functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry/tests/test_configure.py | Added tests to verify that a provided logging_format is correctly processed and applied via a Formatter. |
| sdk/monitor/azure-monitor-opentelemetry/samples/logging/basic.py | Updated sample usage to include the logging_format configuration and updated the logger names accordingly. |
| sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_utils/configurations.py | Added default handling for logging_format within configurations. |
| sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_configure.py | Modified logging setup to create a Formatter with the specified logging_format, handling any exceptions gracefully. |
| sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_constants.py | Added a new constant for logging_format configuration. |
Collaborator
|
API change check API changes are not detected in this pull request. |
jeremydvoss
reviewed
Mar 25, 2025
jeremydvoss
reviewed
Mar 25, 2025
jeremydvoss
approved these changes
Mar 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.