[logback-user] Configure logback, Tomcat and webapps logging

Ceki Gulcu ceki at qos.ch
Wed Feb 2 18:44:53 CET 2011


On 27.01.2011 16:11, Giorgio Maria Santini wrote:
> Hello,
>
> I'm trying to have my webapps logging with logback framework. I'm coming
> from a shell application where I've successfully had my logs handled by
> logback with no problems. Now I'm quite confusing using it with Tomcat.
>
> I've read about logback-access http://logback.qos.ch/access.html and it
> seems ok, but I don't understand where to put my config file for
> logback. Well, each of my webapps should have their own logback.xml
> configuration file, but in the manual it says to put the file in the
> global ${tomcat_home}/config folder, like to deny deploying a webapp
> with its configuration file under WEB-INF/classes path.

Hi Giorgio,
Do keep in mind that logback-access is for access logging, i.e. logs
generated by the container to inform the administator about requests
made to the container.

A rypical access log entry looks like the following (on one line):

127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif \
  HTTP/1.0" 200 2326

Logback-access is installed at the container level, in your case
Tomcat. In contrast, logback-classic is installed at the level of the
web-application to handle logs generated by your software via calls
made to the slf4j api.

Does this help?
--
Ceki



More information about the Logback-user mailing list