logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James A. N. Stauffer" <stauffer.ja...@gmail.com>
Subject Re: please help. everything logged twice
Date Thu, 15 Nov 2007 14:58:55 GMT
It appears that something else is sending the data to the console also.
Posting your whole log4j.properties might help us find the problem.

On Nov 14, 2007 9:21 PM, Jim the Standing Bear <standingbear@gmail.com>
wrote:

> 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
>
>


-- 
James A. N. Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message