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

Add threadId to PatternLayout #711

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

Conversation

rob93c
Copy link
Contributor

@rob93c rob93c commented Oct 9, 2023

Fixes #710, let me know if there should be any other change I need to take care of.

Signed-off-by: Roberto Cella <rob.uniud@gmail.com>
Signed-off-by: Roberto Cella <rob.uniud@gmail.com>
@rob93c
Copy link
Contributor Author

rob93c commented Dec 5, 2023

Hi @ceki, can you please confirm if the failing Github action is doing so because of an unrelated issue?

public class ThreadIdConverter extends ClassicConverter {

public String convert(ILoggingEvent event) {
return String.valueOf(Thread.currentThread().getId());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be present in the ILoggingEvent and retrieved from there? Otherwise this can return the thread id of an internal logback thread, not the id of the actual caller thread, e.g. in an AsyncAppender. See prepareForDeferredProcessing() in the default impl class LoggingEvent.

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.

Add threadId to PatternLayout
2 participants