Skip to content
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

Add logging_format configuration option in api #40057

Merged
merged 9 commits into from
Mar 26, 2025
Merged

Conversation

lzchen
Copy link
Member

@lzchen lzchen commented Mar 12, 2025

No description provided.

@Copilot Copilot bot 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

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
Collaborator

API change check

API changes are not detected in this pull request.

@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
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.

3 participants