Skip to content

Logs Enabled: implement Development-status conditions (minimum_severity, trace_based) #5525

Open

Description

@ocelotl

What

Implement the remaining, Development-status conditions of the Logs Enabled spec in the SDK: severity-based filtering (minimum_severity) and trace-based filtering (trace_based).

Background

PR #5380 adds Logger.enabled() and implements the stable conditions of the spec's Enabled section:

  • there are no registered LogRecordProcessors
  • LoggerConfig.enabled is false (handled in Logger.enabled())
  • all registered LogRecordProcessors implement Enabled and each returns false

The spec lists two further conditions under which Enabled MUST return false, both currently marked [Development]:

  • the provided severity is specified (not 0) and is less than the configured minimum_severity
  • trace_based is true and the current context is associated with an unsampled trace

These were intentionally deferred out of #5380 (see #5380 (comment) and the issue discussion at #5360 (comment)).

Why deferred

  • Both conditions are still Development status in the spec and subject to change.
  • _LoggerConfig currently only has is_enabled; these conditions require adding minimum_severity and trace_based fields to the config model first. The tracer analog _TracerConfig also only has is_enabled, so the config model should grow consistently across signals (related: Public API for setting logger/tracer configuration programmatically #5524).

Proposed scope

  • Add minimum_severity and trace_based fields to _LoggerConfig.
  • Have Logger.enabled() return false when the provided severity is below minimum_severity, and when trace_based is set and the current context is an unsampled trace.
  • Track the spec closely, since these conditions are Development status.

cc @aabmass @herin049

Activity

  1. djbell261 commented on Aug 21, 2026

    @djbell261

    Hi, I'd be interested in working on this. Since "minimum_severity" and "trace_based" require extending "_LoggerConfig", is this ready for implementation as proposed, or should it wait on the configuration work in #5524?

  2. ocelotl commented on Sep 7, 2026

    @ocelotl
    ContributorAuthor

    Hi, I'd be interested in working on this. Since "minimum_severity" and "trace_based" require extending "_LoggerConfig", is this ready for implementation as proposed, or should it wait on the configuration work in #5524?

    hey @djbell261 thanks for offering

    this one does not need to wait on #5524, the real dependency is #5380 (which is pretty much ready to be merged). Are you still interested in working on this issue? if not I can take it ✌️

  3. djbell261 commented on Sep 10, 2026

    @djbell261

    Yep, I’m still interested in working on this! Thanks for clarifying the dependency. I’ll base the work on #5380 and start looking into adding minimum_severity and trace_based to _LoggerConfig along with the corresponding Logger.enabled() behavior. Thank You!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions