Log4j2 on Tomcat 10 fine with Console appender but only logs the startup Tomcat messages, not mine #2994
Replies: 2 comments 2 replies
-
I suggest you enable the StatusLogger debug logging. I am betting you will see Log4j initialize twice - once for Tomcat and once for your web app. I am also betting your web app will NOT be using log4j2-tomcat.xml. |
Beta Was this translation helpful? Give feedback.
-
Hi @cnGitHubBruno, If your applications are bundled with I recently published a couple of Tomcat classloaders that allow administrators to use a global Log4j API installation without having to entirely invert the classloader delegation model. <!-- Use global Log4j API global installation -->
<Loader loaderClass="eu.copernik.tomcat.log4j.loader.Log4jParallelWebappClassLoader"/> to your <!-- Prefer global libraries over application specific -->
<Loader delegate="true"/> Check also my Logging in Tomcat using Log4j Core guide. Note: These artifacts are published under my personal |
Beta Was this translation helpful? Give feedback.
-
I am 99% certain that I messed up something in the log4j2-tomcat.xml but I can't see it. Or is it something else?
I would greatly welcome any advice.
Syptoms:
Configuration:
log4j2-tomcat.xml file contents:
Beta Was this translation helpful? Give feedback.
All reactions