tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Gordon <>
Subject Re: Logging individual web applications
Date Tue, 04 Mar 2008 19:24:29 GMT

First, I assume you meant to say the WEB-INF/classes directory as that's 
where the file needs to be placed for a given web app.

Second, you probably don't want to set the rootLogger to DEBUG as any 
libraries you use could potentially be affected by this and if you've 
ever used Apache libraries before, their verbose logging is VERY 
verbose...  a better way is to set it to INFO, and then define any 
package specific loggers ala:

log4j.rootLogger=INFO, cc1

# lock down apache logging to only INFO or higher

# lock down quartz logging to only INFO or higher

# webapp specific loggers

Thirdly, I don't see the threshold set anywhere (and I don't know what 
the default is), ala:

This level basically dictates the lowest level of logging that is to be 
permitted by ALL loggers so it should be set to the finest level possible.

If none of this helps, pull the file out of your webapp 
and just write a test java class that uses it and prints out a logging 
statement at each level.  This way you don't have to restart your webapp 
every time you tweak your properties file to get it working.  Use a 
log4j provided Appender so you don't have to muck with your custom one.  
If it works right away, w/ no other modifications to the appender 
definition, then the problem lies within your custom appender.



Neha Agrawal wrote:
> Hello
>        i have configured log4j for system logging in
> Tomcat5.5 .Als othe log is rotating..
> Now iwant to configure my individual web-apps using
> log4j
> i have copied log4j.jar and common-logging.jar and the
> Date-File-appender.jar files in the web-apps lib
> directory and also created file in
> the webapps classes directory..
> how do i configure this
> i used the following configuration, but nothing is
> being logged by my webapp..
> log4j.rootLogger=DEBUG,S
> log4j.appender.S=biz.minaret.log4j.DatedFileAppender
> log4j.appender.S.layout=org.apache.log4j.PatternLayout
> log4j.appender.S.layout.ConversionPattern=%d [%t] %-5p
> %c - %m%n
> log4j.appender.S.Directory=/usr/share/tomcat5.5.25/webapps/sample/logs
> log4j.appender.S.Prefix=sample.
> # Suffix: The log file name suffix.
> log4j.appender.S.Suffix=.log
> Is some thing wrong in this?
> Thanks
> nEha
>       Why delete messages? Unlimited storage is just a click away. Go to
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message