-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rolling problem -Dlog4j.configurationFile with two log4j2.xml files #1258
Comments
What do you see with -Dlog4j2.debug=true set? Can you please provide those logs |
In attach the logs retrieved after Dlog4j2.debug=true setting. |
Your problem is caused by multiple Log4j2 is perfectly capable of sharing the same log file between logging context, if a single copy of Unlike full application servers such as Wildfly, Tomcat has not easy way to share a single library between web applications. In order to do that you need to install a set of Log4j2 artifacts in the
You can find such a classloader in my personal repository (cf.
To use it, place it in the
to your |
Description
I use the Apache Tomcat.
We have configured the log4j2 Java Options Arguments: -Dlog4j.configurationFile={/path1}/log4j2.xml,{/path2}/log4j2.xml.
The two files are related one for Web Application and the other for WebServices (so the JDK is the same), on startup the logs collected are:
I use the DefaultRolloverStrategy max="5", with the number of retention days, below is an example:
The problem is that in after the file rolling, no more log are produced and the rotated file stays at zero length:
Configuration
Operating system:
Application server:
Log4j2 Version:
JDK:
Logs
No logs
Reproduction
Configure tomcat with two different log4j2.xml file and different attributes, when log4j start rolling, the lines log not add in the new file and no more log are produced.
The text was updated successfully, but these errors were encountered: