-
Notifications
You must be signed in to change notification settings - Fork 18
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
race condition in Log4jAdapterLabelPrinter #74
Labels
log4j2-appender
Relates to Log4j2 Appender component
Comments
thgau
changed the title
raze condition in Log4jAdapterLabelPrinter
race condition in Log4jAdapterLabelPrinter
Oct 20, 2021
Hi, thanks a lot for reporting. I can confirm it, and it is quite obvious when someone points it out. I will try to push a fix today. |
tkowalcz
added a commit
that referenced
this issue
Oct 20, 2021
…ocal StringBuilder in Log4jAdapterLabelPrinter that can be shared between many threads.
tkowalcz
added a commit
that referenced
this issue
Oct 20, 2021
tkowalcz
added a commit
that referenced
this issue
Oct 21, 2021
I have released version |
Great, it works! Thanks for the fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a problem with multiple threads in class Log4jAdapterLabelPrinter.
The StringBuilder allocated there is shared between threads. It might happen that the threads corrupt the data if both are using it at the same time.
I think the StringBuffer should be allocated once per Thread and kept in a ThreadLocal storage.
Best Regards,
thgau
The text was updated successfully, but these errors were encountered: