Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.4, 2.4.1, 2.5
-
None
Description
Tomcat warns at SEVERE level about a ThreadLocal leak (AsyncLogger$Info).
Steps to reproduce:
- Make all loggers async by using the AsyncLoggerContextSelector
- Place the log4j jar files in the web app's WEB-INF/lib folder, and the configuration file in the class path or in a location configured in the web.xml
- Start the web app, trigger some logging, then stop the web app.
Tomcat will warn
SEVERE: The web application [webapp] created a ThreadLocal with key of type [org.apache.logging.log4j.core.async.AsyncLogger$Info$1] (value [org.apache.logging.log4j.core.async.AsyncLogger$Info$1@136a1c9]) and a value of type [org.apache.logging.log4j.core.async.AsyncLogger.Info] (value [org.apache.logging.log4j.core.async.AsyncLogger$Info@597fb9]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Attachments
Issue Links
- is part of
-
LOG4J2-323 ThreadLocal-leak on tomcat shutdown when using async logging
- Resolved
- relates to
-
LOG4J2-493 Problem with AsyncLogger when web app is deployed/undeployed multiple times
- Resolved