[logback-user] Additional logback config

Christian Lipp Christian.Lipp at xion.at
Tue Jul 3 15:13:11 CEST 2012


I have a web application running under Tomcat with uses Logging separation as described here:

This means that logback jars are located under  ${catalina.home}\lib.

For the build I use maven and perform also a integration test with the maven-failsafe-plugin and the tomcat-maven-plugin. The tomcat-maven-plugin has the logback jars as dependencies, but I do not know how to provide a logback.xml. Of course I could use a ServletContextListener to distinguish programmatically between development and production environment.

What are best practices to separate development logging, integration test logging and production logging when development logging should use the config inside the war and production logging should use the logging set up by the operational team in the Tomcat?

Is it possible to determine if the logging infrastructure is set up or not? I could use this information in a ServletContextListener to force a new initialisation.

Is it possible to tell logback to use the config file in WEB-INF\classes even if the logback jars are located under  ${catalina.home}\lib?

Kind regards, CL

More information about the Logback-user mailing list