You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Shapira, Yoav" <Yo...@mpi.com> on 2002/12/12 17:20:48 UTC

[OFF-TOPIC] RE: Tomcat & log4j

Hi,
I've marked this as off-topic since it's more a log4j question that a
tomcat question.

Are you configuring log4j more than once?  Maybe once with a
BasicConfigurator.configure() and once with a
PropertyConfigurator.configure() call?  That would explain the
additional console appender even though there isn't one in your
properties file.

BTW, do you really specify the level for each and every class in your
properties file, or did you just give one as an example??

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Wendy Smoak [mailto:Wendy.Smoak@asu.edu]
>Sent: Thursday, December 12, 2002 11:06 AM
>To: 'Tomcat Users List'
>Subject: 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

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>