Skip to content

Do not execute log processors below configured log level #353

@benwebber

Description

@benwebber

Currently, log processors always execute, even if their log level is lower than the currently set log level.

Consider the configuration below. If the current log level is not TRACE, I would not expect the mapping to execute.

input:
  generate:
    mapping: |
      root = {}

pipeline:
  processors:
    - log:
        level: TRACE
        fields_mapping: |
          root = throw("foo")

output:
  stdout: {}

This would be a minor performance improvement, and matches how log formatting works in other languages (e.g. Python).

The log processor states that the message remains unchanged, so skipping its execution would have no effect on the pipeline.

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