Skip to content

Implementing minimum_severity and trace_based attributes for LoggerConfig#4131

Open
om7057 wants to merge 2 commits into
open-telemetry:mainfrom
om7057:fix/experimental-logger-config
Open

Implementing minimum_severity and trace_based attributes for LoggerConfig#4131
om7057 wants to merge 2 commits into
open-telemetry:mainfrom
om7057:fix/experimental-logger-config

Conversation

@om7057
Copy link
Copy Markdown

@om7057 om7057 commented Jun 6, 2026

Fixes #4130

Changes

Description

Implements the missing minimum_severity and trace_based attributes for LoggerConfig in the declarative configuration spec.

Previously, LoggerConfigConfiguration only had an enabled boolean field. This PR adds:

  • minimum_severity (type: SeverityNumber, default: trace) — allows filtering log records by severity level
  • trace_based (type: bool, default: false) — enables/disables trace-based log filtering

These attributes align with the OpenTelemetry specification for logger configuration and enable users to control logging behavior via YAML configuration.

Example YAML usage:

logger_provider:
  logger_configurator/development:
    default_config:
      enabled: true
      minimum_severity: warn
      trace_based: false
    loggers:
      - name: my.noisy.logger
        config:
          minimum_severity: error
          trace_based: true

For significant contributions, please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@om7057 om7057 requested a review from a team as a code owner June 6, 2026 07:55
@om7057
Copy link
Copy Markdown
Author

om7057 commented Jun 6, 2026

Hi @marcalff could you please review the changes in this PR, and assign the issue?

@proost
Copy link
Copy Markdown
Contributor

proost commented Jun 6, 2026

Can you update CHANGELOG.md?

@om7057
Copy link
Copy Markdown
Author

om7057 commented Jun 6, 2026

Can you update CHANGELOG.md?

Yes, I've updated the CHANGELOG.md file as well. Could you please review all my changes and confirm whether this PR resolves the issue #4130 ?

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.02%. Comparing base (e649c7f) to head (0e0e2cd).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4131      +/-   ##
==========================================
+ Coverage   81.94%   82.02%   +0.09%     
==========================================
  Files         385      385              
  Lines       16067    16071       +4     
==========================================
+ Hits        13164    13181      +17     
+ Misses       2903     2890      -13     
Files with missing lines Coverage Δ
sdk/src/configuration/configuration_parser.cc 77.04% <100.00%> (+0.90%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CONFIGURATION] File configuration - ExperimentalLoggerConfig

2 participants