Attaching sample test program for simulated multithreading logging.

From: Pooja Pandey <>
Sent: Friday, March 25, 2022 4:37 AM
To: Log4J Users List <>
Subject: Synchronization issue in multithreading (Losing huge data in 
multithreading) with log4j 1.x bridge (2.17.2)

*** External email: Verify sender before opening attachments or links ***


In our application we have migrated from log4j1.x to log4j1.x bridge. With 
Log4j1.x there was no issue with multithreading but with log4j 1.x bridge we 
have noticed that in multithreading environment there is a huge data loss while 
logging, however single thread works fine. I see that in which 
Logger extends; many methods are not synchronized any more in log4j1.x bridge 
however which were in case of log4j1.x. I suspect this could be root cause of 
this multithreading problem. Please let me know if you have any idea.

I have compared which is a kind of core class for logging 
functionality in Log4j1.x and Log4j1.x bridge and I see that many methods which 
we are using were synchronized in log4j1.x but NOT in log4j1.x bridge. I think 
this could be one of the root causes leading to this problem.


Log4j1.x:   synchronized public Appender getAppender(String name)
Log4j1.x bridge:     public Appender getAppender(final String name)

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to