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
log4j.properties 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 
file

/var/log/tomcat/mywebapp.log

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 log4j.properties
file?

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

Kind regards,
Bart

----------------------- log4j.properties ------------------------------
log4j.rootLogger=DEBUG, cons
log4j.logger.com.jspservletcookbook=, myAppender

# The root logger's appender
log4j.appender.cons=org.apache.log4j.ConsoleAppender

# The com.jspservletcookbook logger's appender
log4j.appender.myAppender=org.apache.log4j.RollingFileAppender

log4j.appender.myAppender.File=testbart.log
log4j.appender.myAppender.MaxBackupIndex=1
log4j.appender.myAppender.MaxFileSize=1MB

# The root logger's layout
log4j.appender.cons.layout=org.apache.log4j.SimpleLayout

# The com.jspservletcookbook logger's layout
log4j.appender.myAppender.layout=org.apache.log4j.PatternLayout

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to