[logback-user] How to control WebApp logging by Tomcat control files

Ulrich Forums at gombers.de
Fri Apr 18 21:12:25 CEST 2014


Being new to WebApps, I started with TOMCAT 7 and try to do Logging with
LOGBACK. I'm doing this already on WebApp Basis by adding all necessary
resources to the WebApp Environment (WEB-INF). 
Here I'm using the ConsoleAppender and all messages are captured then by the
default java.util.logging and stored to a file (just TOMCAT 7 default
configuration).
I found the explanation to replace java.util.logging by logback
(http://logback.qos.ch/access.html) and got it running. But don't understand
how it works.
1. I tried the sample configuration "Example 2: RollingFileAppender" but am
still wondering where it's stored. Though the StatusMessageServlet displays
some messages, I can't figure out from where they are retrieved. Only
specifying <file>${catalina.base}/logs/access.log</file> directed the file
to a known location.
2. The access.log was not zipped as indicated  by the definition
"<fileNamePattern>/access.%d{yyyy-MM-dd}.log.zip</fileNamePattern>" nor did
it contain the messages displayed by the StatusMessageServlet
3. I've no clue how to control the WebApp logging by the central
configuration file. I would prefer controlling logging be central config
files rather than be files maintained by the WebApp itself. How can I manage
to connect my WebApp to the central logback.xml

I hope the questions make any sense. I'm lacking some fundamental
understanding with logging by Tomcat.
 



--
View this message in context: http://logback.10977.n7.nabble.com/How-to-control-WebApp-logging-by-Tomcat-control-files-tp13547.html
Sent from the Users mailing list archive at Nabble.com.


More information about the Logback-user mailing list