tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bart Vandewoestyne <>
Subject Logging with Log4J
Date Fri, 04 Dec 2009 15:02:51 GMT
Hello list,

Up until now, I have used simple System.out.println() statements
to do the logging of my web applications, but I want to start
using a more advanced system with more possibilities.  Log4J
seemed like a good choice.  The most important thing for me is that the
log messages are written nicely into a separate file.

Based on stuff I found using Google, I have created a file (see bottom of this mail) which is saved under
the WEB-INF/classed directory.

It seems like things are working *partly*... because although I
do specify the file testbart.log, there is no testbart.log file
on the tomcat server (i checked this with find / -name
testbart.log as root).  I *do* however see log messages appearing
in /var/log/syslog, but that is not what i want.  I want them to be written
into a separate logfile.

Can somebody point me in the right direction here?  All i want is
that the logs for my webapp (written using Log4J) are written in to a 


It is however unclear to me where i have to configure this... is
it a Debian config thing?  Is it a Tomcat config thing?  Is it a
log4J config thing?  Do I config this in the

Just for the record: we're using Tomcat 5.5 on a Debian GNU/Linux
stable system.

Kind regards,

----------------------- ------------------------------
log4j.rootLogger=DEBUG, cons, myAppender

# The root logger's appender

# The com.jspservletcookbook logger's appender


# The root logger's layout

# The com.jspservletcookbook logger's layout

log4j.appender.myAppender.layout.ConversionPattern=%-5p Logger:%c{1} Date: %d{ISO8601} - %m%n

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message