Logback with Tomcat 7

Hello, today I've changed the WAR file of my App to only contain the classes of my project. All other dependencies , also logback, I put into the tomcat/lib folder. The logback.xml is still in my WAR, but it looks like it is now ignored. Then I put the logback.xml also into the lib folder and changed it, that it configures only the root logger. Seems to work, but my logback.xml in the WAR file is still ignored. How can a set up a global logging and in addition configure logging on a per webapp basis? Regards Martin

On 04.06.2012 13:51, martin.burchard@pentos.com wrote:
Hello,
today I've changed the WAR file of my App to only contain the classes of my project. All other dependencies , also logback, I put into the tomcat/lib folder. The logback.xml is still in my WAR, but it looks like it is now ignored.
Then I put the logback.xml also into the lib folder and changed it, that it configures only the root logger. Seems to work, but my logback.xml in the WAR file is still ignored.
How can a set up a global logging and in addition configure logging on a per webapp basis?
Hi Martin, If you include logback-classic.jar in Tomcat's "global" lib folder, you cannot configure logging on a per-app basis unless you use ContextJNDISelector. The topic is discussed in some detail at [1]. Have you had a chance to look at it? [1] http://logback.qos.ch/manual/loggingSeparation.html
Martin -- Ceki http://twitter.com/#!/ceki
participants (2)
-
ceki
-
martin.burchard@pentos.com