I've a tomcat 8.5 instance running with several WAR's deployed, each of them writing its internal output via System.out
to console.
Now, tomcat combines all this log outputs together in one file: catalina.out, but I would like to separate them. Is it possible to configure tomcat's logging properties to create different catalina.outs on a per-WAR-base, e.g.
- console output of app1.war -> catalina-app1.out
- console output of app2.war -> catalina-app2.out
…
Thanx
Tom
Best Answer
put "swallowOutput" in your context.xml
and add an individual logging.properties file into each of your webapps/wars at the position
You can put this file also in the source-folder if your WAR is generated, e.g. by eclipse
The logging.properties may have the following contents
and you can define the name prefix for each individual webapp log with
org.apache.juli.FileHandler.prefix