tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey Janner" <>
Subject RE: Logging with Log4J
Date Fri, 04 Dec 2009 15:17:37 GMT
Change your first line from "DEBUG, cons" to "DEBUG, myAppender"

-----Original Message-----
From: Bart Vandewoestyne [] 
Sent: Friday, December 04, 2009 9:03 AM
Subject: Logging with Log4J

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
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:

*******************************  NOTICE  *********************************
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.

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

View raw message