logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim the Standing Bear" <standingb...@gmail.com>
Subject please help. everything logged twice
Date Thu, 15 Nov 2007 03:21:05 GMT
Hi,

I have been scratching my head trying to figure out why my application
is logging everything twice.

Below is the log4j.properties file

[code]
log4j.logger.com.mydomain.myapp=TRACE, myconsole

log4j.appender.myconsole=org.apache.log4j.ConsoleAppender
log4j.appender.myconsole.Threshold=TRACE
log4j.appender.myconsole.layout=org.apache.log4j.PatternLayout
log4j.appender.myconsole.layout.ConversionPattern=%-34d{DATE} [%t]
%-5p %c %x -%m%n
[/code]

But whenever I run it, it would log two lines of everything, one with
the time, the next one without

[code]

14 Nov 2007 22:09:12,558           [main] INFO
com.mydomain.myapp.util.Util  -Property CONNECTION_POOL_SIZE = 5
[main] INFO  util.Util  - Property CONNECTION_POOL_SIZE = 5
14 Nov 2007 22:09:12,558           [main] INFO
com.mydomain.myapp.util.Util  -Property BROKER_COUNT = 1
[main] INFO  util.Util  - Property BROKER_COUNT = 1

[/code]

However, if I comment out either one of the last two lines in the
properties file, i.e. either specifying PatternLayout, or specifying
ConversionPattern, but not both,  it would print only a single line,
however, the date-time stamp will never be present in such cases.  And
of course, if the line that specified PatternLayout was commented out,
it also generated errors.  So I dont understand what I did wrong.
Please help. Thanks.

[code]
log4j:ERROR Could not find value for key log4j.appender.myconsole.layout
log4j:ERROR No layout set for the appender named [myconsole].

[main] INFO  util.Util  - Property CONNECTION_POOL_SIZE = 5
[main] INFO  util.Util  - Property BROKER_COUNT = 1

[/code]


-- jim

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message