You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sven Schliesing <sv...@schliesing.de> on 2006/03/22 00:08:47 UTC

log4j not logging 3rd-party-tool-messages in a webapp under tomcat 5.5

Hi,

I already posted this to the log4j-list but got no response. Maybe 
someone of you can help me.


I have this log4j.properties-file within my webapp:
---------------------------
log4j.rootLogger=DEBUG,stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d{ISO8601}, %-5p] {%x} 
%.40c:%L: %m%n
---------------------------

The webapp runs under Tomcat 5.5.15. I would expect this config-file to 
litter my console with tons of log messages. But it only displays the 
messages from my webapp. None of the 3rd-party-tool-messages, like from 
hibernate or oscache, make it to the console.

Even an explicit logger-declaration for eg. hibernate does not work:
log4j.logger.org.hibernate=DEBUG

The config file is really read by the application. So when I change
log4j.rootLogger=DEBUG,stdout
to
log4j.rootLogger=INFO,stdout
no DEBUG-messages from my application get displayed anymore.

Did I miss something in the configuration?

Many thanks in advance!


Sven


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


Re: log4j not logging 3rd-party-tool-messages in a webapp under tomcat 5.5

Posted by Sven Schliesing <sv...@schliesing.de>.
Hi,

this doesn't help either. I'm pretty sure now that it has to do with the 
standard-logging-mechanism of tomcat.
On the console I see log-messages like these:

22.03.2006 02:26:18 com.opensymphony.oscache.base.Config loadProps
INFO: Properties {cache.path=c:\temp\cache}

and

INFO: Hibernate 3.1.2
22.03.2006 02:26:58 org.hibernate.cfg.Environment <clinit>

So my third-party-libs _are_ logging. The only fault is, that they are 
using the wrong logging-handler. Any hint how I can fix this?

Thanks,

Sven

Darryl L. Miles wrote:
> 
> 
> I use the following, notice the Threshold setting, maybe that can help 
> (I'm not sure how "log4j.appender.stdout.Target=System.out" affects 
> logging) :
> 
> 
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.Threshold=DEBUG
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} 
> (%F:%M:%L)  -%m%n
> 
> Try adding:
> 
> log4j.debug=true
> 
> 

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


Re: log4j not logging 3rd-party-tool-messages in a webapp under tomcat 5.5

Posted by "Darryl L. Miles" <da...@netbauds.net>.

I use the following, notice the Threshold setting, maybe that can help 
(I'm not sure how "log4j.appender.stdout.Target=System.out" affects 
logging) :


log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Threshold=DEBUG
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} 
(%F:%M:%L)  -%m%n

Try adding:

log4j.debug=true


-- 
Darryl L. Miles



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


Re: log4j not logging 3rd-party-tool-messages in a webapp under tomcat 5.5

Posted by Boris Unckel <bo...@gmx.net>.
Good Morning,

> Von: Sven Schliesing <sv...@schliesing.de>
> 
> The webapp runs under Tomcat 5.5.15. I would expect this config-file to 
> litter my console with tons of log messages. But it only displays the 
> messages from my webapp. None of the 3rd-party-tool-messages, like from 
> hibernate or oscache, make it to the console.
> Did I miss something in the configuration?
> 
do hibernate and oscache use log4j directly? Maybe they have commons-logging
as wrapper in use. Have a look at

http://tomcat.apache.org/tomcat-5.5-doc/logging.html
http://jakarta.apache.org/commons/logging/guide.html
http://jakarta.apache.org/commons/logging/troubleshooting.html

how to configure JCL with log4j in Tomcat environment.

Regards
Boris

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