You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wendy Smoak <We...@asu.edu> on 2002/12/12 17:05:45 UTC

Tomcat & log4j

I just got commons-logging + log4j working for my webapp.  But in addition
to getting the log that I set up, which looks like this:
2002-12-12 09:02:49,514 - DEBUG edu.asu.vpia.dao.UniSessionFactory -
connected to /db/udt/devl/bendev

I am also getting those messages in the console with a different pattern:
71751 [Thread-4] DEBUG dao.UniSessionFactory  - connected to
/db/udt/devl/bendev

Can someone clarify what's going on?  I'd rather just have the webapp
messages go to the log file that I've specified, and not also see them on
the console.  My log4j.properties file, which lives in
${TOMCAT_HOME}/webapps/bendev/WEB-INF/classes/ is:

# Create an appender called daily:
log4j.rootLogger=DEBUG, daily
# Create a category for each class, set the level and appender:
log4j.category.edu.asu.vpia.dao.UniSessionFactory=DEBUG, daily
# Configure the daily appender to be a DailyRollingFileAppender
log4j.appender.daily=org.apache.log4j.DailyRollingFileAppender
# Configure the name of the logout for the daily appender
# default location when used with Tomcat is is /path/to/tomcat/bin, 
# so back up one & go into logs
log4j.appender.daily.File=../logs/bendev.log
# Configure the layout pattern and conversion pattern for the daily appender
log4j.appender.daily.layout=org.apache.log4j.PatternLayout
log4j.appender.daily.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n

As far as I know, I am not directing anything to the console, which is why
I'm assuming it's something within Tomcat that now "sees" log4j down in that
webapp and is using it.

Thanks for any hints... I'm a recent convert from System.out.println.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management