Skip to content

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.

@rob93c rob93c force-pushed the add-threadId-converter branch from 0ceb4a7 to 65df97f Compare October 9, 2023 19:33
@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