Is Log4j in WEB-INF/lib or is it only in CATALINA_HOME/common/lib? If the latter, and if you are manually configuring Log4j upon each webapp load, then you will be re-configuring the same logger repository multiple times in the default logger repository; the one which the server itself is using. I don't recall the exact behavior of a reconfiguration, but it doesn't really blow away the old one. It is additive unless you call LogManager.shutdown() (someone please correct me if I'm wrong here) and you wouldn't want to do that on the server's logger repository upon a simple webapp only shutdown with the server still running. I would suggest one of two remedies and they both have to do with logging to a separate logger repository than the one the server (Tomcat) is using...
1. Put log4j.jar in WEB-INF/lib. That way, the logger repository you are using is scoped to the webapp because of Tomcat's parent-last webapp classloading behavior. This may not work in containers that don't support (or don't have on by default) parent-last classloading for webapps.
2. Use a repository selector. Log4j-1.3 becomes much more useful here since the repository selector concept has really matured. You can still use a repository selector with Log4j-1.2, but you may have to go to a bit more effort yourself or check out the tagged 1.3alpha (unofficial version) from the log4j sandbox. Make sure to put the servlet api in the build classpath before building the jar and use the init context listener there. Follow the instructions in the javadoc.
Jake
At 10:27 AM 3/15/2005 -0600, you wrote:
>Are the logs duplicated in txttools-web.log? Are you possibly sending
>logs to the console appender multiple times (at multiple levels)?
>
>Is it automatically configured or do you call code to tell it to use
>your log4j.properties? This sounds like it is being configured
>multiple times.
>
>On Tue, 15 Mar 2005 16:02:19 +0000, John Hunsley <[EMAIL PROTECTED]> wrote:
>> This happens on any logging statement, log4J is configured through
>> Log4j.properties, the file loks like this;
>>
>> log4j.rootLogger=DEBUG, console , file
>>
>> log4j.appender.file=org.apache.log4j.FileAppender
>> log4j.appender.file.File=txttools-web.log
>> log4j.appender.file.layout=org.apache.log4j.PatternLayout
>> log4j.appender.file.layout.ConversionPattern=%-5p [%t] %d{dd/MMM/yyyy
>> HH:mm:ss,SSS} (%c) - %m%n
>>
>> log4j.appender.console=org.apache.log4j.ConsoleAppender
>> log4j.appender.console.layout=org.apache.log4j.PatternLayout
>> log4j.appender.console.layout.ConversionPattern=%-5p [%t] %d{dd/MMM/yyyy
>> HH:mm:ss,SSS} (%c) - %m%n
>>
>> and then I set individual packages to WARN, DEBUG etc.....
>>
>> thanks,
>>
>> John .
>>
>>
>> James Stauffer wrote:
>>
>> >Are you reloading any web apps? How are you configuring log4j?
>> >
>> >On Tue, 15 Mar 2005 14:51:31 +0000, John Hunsley <[EMAIL PROTECTED]>
>wrote:
>> >
>> >
>> >>Hi there,
>> >>
>> >>Im running an app in Tomcat5.0 on Mandrake 10.1. my logging statements
>> >>seem to grow over time. When I boot up tomcat the logging statements for
>> >>each thread are displayed in catalina.out as they should, but after a
>> >>while each statement prints out two or three times, the thread number
>> >>and timestamps are the same. In time this grows and each statement is
>> >>printed out about 50 times clogging my catalina.out file. When I run the
>> >>app in tomcat on Windows this doesnt happen.
>> >>
>> >>Any idea why this phenomenon is occuring?
>> >>
>> >>John.
>> >>
>> >>---------------------------------------------------------------------
>> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >>For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>--
>James Stauffer
>Are you good? Take the test at http://www.livingwaters.com/good/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
