Skip to content

Add logging_format configuration option in api#40057

Merged
lzchen merged 9 commits intoAzure:mainfrom
lzchen:format
Mar 26, 2025
Merged

Add logging_format configuration option in api#40057
lzchen merged 9 commits intoAzure:mainfrom
lzchen:format

Conversation

@lzchen
Copy link
Copy Markdown
Member

@lzchen lzchen commented Mar 12, 2025

No description provided.

Copilot AI review requested due to automatic review settings March 12, 2025 22:16
@lzchen lzchen requested a review from jeremydvoss as a code owner March 12, 2025 22:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added the Monitor - Distro Monitor OpenTelemetry Distro label Mar 12, 2025
@azure-sdk
Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

Comment thread sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md
@lzchen lzchen merged commit 87c7d9a into Azure:main Mar 26, 2025
24 checks passed
@lzchen lzchen deleted the format branch March 26, 2025 13:34
@jeremydvoss jeremydvoss mentioned this pull request Apr 7, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants