Hi Paul,
That did the trick! what I also wanted was for only messages of info or
above to go to the console, so I added the line:
log4j.appender.stdout.threshold=info
Thanks for the javadoc link, it really helped.
Thanks again,
Mike.
From: Paul Smith <[EMAIL PROTECTED]>
Reply-To: "Log4J Users List" <[email protected]>
To: "Log4J Users List" <[email protected]>
Subject: Re: Debug messages going to wrong appender
Date: Wed, 4 Jan 2006 08:45:05 +1100
you additivity configuration snippet is close but no cigar, try:
log4j.additivity.org.hibernate=false
see http://logging.apache.org/log4j/docs/api/org/apache/log4j/
PropertyConfigurator.html#doConfigure(java.lang.String,%
20org.apache.log4j.spi.LoggerRepository)
cheers,
Paul
On 04/01/2006, at 8:40 AM, Michael Stephen wrote:
Hi all,
I am trying to configure log4j for my webapp, and I almost have it
working the way I want :)
I would like all messages of INFO and above to go to the console, and all
messages for specific
packages to go to a file.
My log4j.properties is as folllows:
log4j.rootLogger=info, stdout
log4j.logger.org.hibernate=debug, file
log4j.logger.org.hibernate.additivity=false
log4j.logger.org.springframework=info, file
log4j.logger.org.springframework.additivity=false
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=${webapp.root}/logs/application.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %p [%c] {%l} - %m%n
What I am seeing is that even though the rootLogger is set to INFO, the
org.hibernate DEBUG messages are appearing in the console. The file
correctly just contains org.hibernate and org.springframework messages.
Anyone have any ideas what I'm doing wrong?
Thanks,
Mike Stephen.
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]