0

I have a normal webapp and a lib that will be loaded by the common class loader. What is the correct setup, especially where to place the log4j2.xml config file to have the two components share the same logging config and log to the same logfile.

Thank you in advance Fireball

fireball29
  • 11
  • 6

1 Answers1

0

I believe this will solve your question. Please note to get the correct libraries depending on your Tomcat version: tomcat 7 internal logging with log4j2.xml

Community
  • 1
  • 1
  • I found this article already, but it's a sligtly different topic. The problem I have, is that the component loaded by the common classloarder picks up the log4j2.xml, but the webapp does not, because I assume it's out of scope of the webapp classloader. – fireball29 Aug 11 '15 at 08:11
  • See http://logging.apache.org/log4j/2.x/manual/logsep.html. If I understand you correctly it sounds like you want to use the BasicContextSelector so that the web application(s) will share the configuration used by the common loader. – rgoers Aug 14 '15 at 05:34