You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Security Management <li...@secmgmt.com> on 2009/04/21 15:32:46 UTC

Log messages appearing twice

Here is my log4j config file:

log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=${catalina.home}/logs/test.log

log4j.appender.A1.MaxFileSize=100MB
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

log4j.rootLogger=INFO, A1


All of my messages are printing twice in the logfile.  Does anyone have any
idea why?  I've used log4j before, in standalone apps, and not had this
problem.





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


Re: [OT] Log messages appearing twice

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

SM,

Marking as OT because this is not Tomcat-related.

On 4/21/2009 12:15 PM, Security Management wrote:
> In the application log, separate file (the test.log). I only have 1
> copy of log4j.jar in the apache directory, too (my webapps copy).
> 
> Here's an example:
> 2009-04-21 11:50:59,903 [main] DEBUG com.secmgmt.beans.picture.four.PPDoorProvider - Loading Door Provider
> 2009-04-21 11:50:59,903 [main] DEBUG com.secmgmt.beans.picture.four.PPDoorProvider - Loading Door Provider

[...]

> log4j.appender.A1=org.apache.log4j.FileAppender
> log4j.appender.A1.File=${catalina.home}/logs/test.log
> 
> log4j.appender.A1.MaxFileSize=100MB
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> 
> log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
> 
> log4j.rootLogger=INFO, A1

This is either not your log4j configuration file, not your entire log4j
configuration file, or not the one actually being used: you have DEBUG
messages in your log file when your root logger specifically says that
INFO is the lowest level to log.

Care to post corroborating configuration and results?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknuOekACgkQ9CaO5/Lv0PAyqwCgmlQNNHmAUZUeFxwbdkE6xXMQ
19UAoJWM8Cq+xRl0KWLZ9yTCcFv8cz0i
=U9JE
-----END PGP SIGNATURE-----

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


RE: Log messages appearing twice

Posted by Security Management <li...@secmgmt.com>.
In the application log, separate file (the test.log).  I only have 1 copy of log4j.jar in the apache directory, too (my webapps copy).


Here's an example:
2009-04-21 11:50:59,903 [main] DEBUG com.secmgmt.beans.picture.four.PPDoorProvider - Loading Door Provider
2009-04-21 11:50:59,903 [main] DEBUG com.secmgmt.beans.picture.four.PPDoorProvider - Loading Door Provider
2009-04-21 11:50:59,934 [main] INFO  com.secmgmt.beans.picture.four.UserFieldManagerProvider - Loading managers from user's user field #1
2009-04-21 11:50:59,934 [main] INFO  com.secmgmt.beans.picture.four.UserFieldManagerProvider - Loading managers from user's user field #1
2009-04-21 11:50:59,946 [main] DEBUG com.secmgmt.struts2.interceptors.OperatorHistoryInterceptor - Operator History logging started
2009-04-21 11:50:59,946 [main] DEBUG com.secmgmt.struts2.interceptors.OperatorHistoryInterceptor - Operator History logging started
2009-04-21 11:51:01,443 [main] DEBUG com.secmgmt.struts2.interceptors.OperatorHistoryInterceptor - Operator History logging started
2009-04-21 11:51:01,443 [main] DEBUG com.secmgmt.struts2.interceptors.OperatorHistoryInterceptor - Operator History logging started
2009-04-21 11:56:28,272 [TP-Processor3] DEBUG com.secmgmt.struts2.text_provider.DatabaseResourceBundle - Loading resources
2009-04-21 11:56:28,272 [TP-Processor3] DEBUG com.secmgmt.struts2.text_provider.DatabaseResourceBundle - Loading resources



-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: Tuesday, April 21, 2009 11:03 AM
To: Tomcat Users List
Subject: Re: Log messages appearing twice

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

S&M,

On 4/21/2009 9:32 AM, Security Management wrote:
> Here is my log4j config file:
> 
> log4j.appender.A1=org.apache.log4j.FileAppender
> log4j.appender.A1.File=${catalina.home}/logs/test.log
> 
> log4j.appender.A1.MaxFileSize=100MB
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> 
> log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
> 
> log4j.rootLogger=INFO, A1
> 
> All of my messages are printing twice in the logfile.

Application log messages or Tomcat log messages? Are you using log4j
only in your application or are you also using log4j for server logging?
Can you give us an example of a repeated log message?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknt4AsACgkQ9CaO5/Lv0PA6AwCgs+bkRspiCv0D2C8uAkRCz55E
irMAoLD8oWXoKTvW2dcgjFexEh1FaJDV
=r9Z1
-----END PGP SIGNATURE-----

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


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


Re: Log messages appearing twice

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

S&M,

On 4/21/2009 9:32 AM, Security Management wrote:
> Here is my log4j config file:
> 
> log4j.appender.A1=org.apache.log4j.FileAppender
> log4j.appender.A1.File=${catalina.home}/logs/test.log
> 
> log4j.appender.A1.MaxFileSize=100MB
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> 
> log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
> 
> log4j.rootLogger=INFO, A1
> 
> All of my messages are printing twice in the logfile.

Application log messages or Tomcat log messages? Are you using log4j
only in your application or are you also using log4j for server logging?
Can you give us an example of a repeated log message?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknt4AsACgkQ9CaO5/Lv0PA6AwCgs+bkRspiCv0D2C8uAkRCz55E
irMAoLD8oWXoKTvW2dcgjFexEh1FaJDV
=r9Z1
-----END PGP SIGNATURE-----

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