Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Check value instead of name for not null when collecting MDC entries? #161

Closed
2 of 3 tasks
jhorstmann opened this issue Nov 1, 2018 · 1 comment
Closed
2 of 3 tasks
Labels
type: bug A general bug

Comments

@jhorstmann
Copy link
Contributor

While reading the code handling MDC values I came across the following snipped in LogbackLogEvent v1.12.0 and was wondering if this is working as intended or whether it should be checking mdcValue instead of mdcName

        for (String mdcName : matchingMdcNames) {
            String mdcValue = getMdcValue(mdcName);
            if (mdcName != null) {
                result.setValue(mdcName, mdcValue);
            }
        }

This is not causing any issues for me at the moment, I'm just curios :)

Make sure that:

  • You have read the contribution guidelines.
  • You specify the logstash-gelf version and environment so it's obvious which version is affected
  • You provide a reproducible test case (either descriptive of as JUnit test) if it's a bug or the expected behavior differs from the actual behavior.
@mp911de mp911de added the type: bug A general bug label Nov 1, 2018
@mp911de
Copy link
Owner

mp911de commented Nov 1, 2018

We should fix that. Smells like a bug. Care to submit a pull request?

jhorstmann added a commit to jhorstmann/logstash-gelf that referenced this issue Nov 1, 2018
mp911de added a commit that referenced this issue Nov 18, 2018
Add author tag. Align JUL/Log4j/Log4j2 MDC handling to skip fields with null values.
mp911de pushed a commit that referenced this issue Nov 18, 2018
mp911de added a commit that referenced this issue Nov 18, 2018
Add author tag. Align JUL/Log4j/Log4j2 MDC handling to skip fields with null values.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants