Your log4j configuration will be raised by log4j if you put it in the classpath of your web application, for example. in WEB-INF / classes /. Make sure your log4j.jar is in WEB-INF / lib.
The output of the Consolidator that you defined, which registers with stdout, will go to $ {CATALINA_BASE} /logs/catalina.out, like any output from stdout Tomcat.
As for RollingFileAppender, you have to determine the right path. If you want the logs of your web application to appear in the Tomcat log directory, change the file for this application to:
log4j.appender.file.File=${catalina.base}/logs/test.log
source share