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

Set LOG_CORRELATION_PATTERN only when correlation ID is expected #39333

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danielhcx
Copy link

Prior to this commit, if logging.pattern.correlation has been set, then the correlation ID is logged regardless of the flag logging.expect-correlation-id. This is different from what happens with the default correlation patterns.

This commit updates LoggingSystemProperties so that the system property LOG_CORRELATION_PATTERN is set when logging.expect-correlation-id is true. If it is false then the correlation ID won't be logged in any cases.

This also follows gh-38641 from the perspective of logging.

Prior to this commit, if `logging.pattern.correlation` has been set,
then the correlation ID is logged regardless of the flag
`logging.expect-correlation-id`. This is different from what happens
with the default correlation patterns.

This commit updates LoggingSystemProperties so that the system property
`LOG_CORRELATION_PATTERN` is set when `logging.expect-correlation-id`
is `true`. If it is `false` then the correlation ID won't be logged in
any cases.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 30, 2024
Format the code by running the `format` Gradle task.
@wilkinsona
Copy link
Member

Thanks for the PR. This looks sensible to me but I'd like to double-check with the rest of the team and @jonatan-ivanov.

@wilkinsona wilkinsona added the for: team-attention An issue we'd like other members of the team to review label Feb 9, 2024
@philwebb philwebb changed the title Set LOG_CORRELATION_PATTERN only when correlation ID is expected Set LOG_CORRELATION_PATTERN only when correlation ID is expected Feb 14, 2024
@philwebb philwebb self-assigned this Mar 28, 2024
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants