Hi,

Is there any thread name caching going on with log4j2 (doesn't matter 
sync/async)? If I have a thread pool of tasks and call 
Thread.currentThread().setName (with unique id) in the beginning of the task 
execution, I sometimes see reuse of previous thread name in the log statements. 
Id is UUID, so it's definitely unique. And if I do System.out on the current 
thread name after setting it, I do see the new name as expected. But in log 
statements the thread name is from the previous set. The pattern layout is: 
[%date{DEFAULT}{UTC}Z][%level][%thread:%tid][%c{3}] %message%n

log4j:2.7

Any ideas what could be causing the thread name reuse?

Thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to