tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Rameder" <>
Subject AW: AW: logging log4j of my application
Date Mon, 21 May 2007 13:21:00 GMT
The output of the log file should be information about hibernate, spring and
my development in the net.thefource package. 
I have used this for a GUI application where it is working
fine and also by testing the server with JUnit all debug information are
I am starting the tomcat with the startup.bat. Hence it is not a service.

A example for the GUI application would be:
14:07:25,500 () [INFO ] CollectionFactory (<clinit>) - JDK 1.4+ collections


log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x) [%-5p]
%c{1} (%M) - %m%n
log4j.appender.FILE.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x) [%-5p]
%c{1} (%M) - %m%n
# Keep one backup file
log4j.appender.FileApp.layout.ConversionPattern=%d{HH:mm:ss,SSS} (%x) [%-5p]

-----Urspr√ľngliche Nachricht-----
Von: Rainer Jung [] 
Gesendet: Montag, 21. Mai 2007 13:55
An: Tomcat Users List
Betreff: Re: AW: logging log4j of my application

All right, so we assume, there are no log4j things lying around in your 
Tomcat apart from your webapp. Also please check, that the running 
Tomcat process has no -Dlog4j.configuration  in its commandline.

It could be, that you have a servlet initialization, that configures 
log4j via its API, but let's assume this is not the case.

Then even without the context-param, the in your 
WEB-INF/classes should be found as the default configuration. Maybe the 
context-param is an indicator, that there is explicit log4j 
initialization code in your webapp and you are not using autoconfiguration.

In both cases we assume it really picks up the 

So if a file gets created but nothing gets logged into it, we should 
have a look at the contents of the file. You should 
post it.

Also: which messages would you expect there?



Marc Rameder wrote:
> I deploy a war file with the following content.
> 	classes:
> 	   contains the file in the root directory. Only
> one 	   exists.
> 	lib:
> 	   contains the log4j-1.2.9.jar not in any other directory
> my web.xml contains
> <context-param>
>     <param-name>log4jConfigLocation</param-name>
>     <param-value></param-value>
>   </context-param>
> I hope that's the information you ask for!
> thanks
> marc
> -----Urspr√ľngliche Nachricht-----
> Von: Rainer Jung [] 
> Gesendet: Montag, 21. Mai 2007 13:27
> An: Tomcat Users List
> Betreff: Re: logging log4j of my application
> How do you deploy the log4j Jar? Which place? Several places?
> Where do you keep your log4j configuration file? One file, several ones?
> Which mechanism did you choose to publish the files to log4j?
> The questions concerning "several" always mean: are those things only in 
> your webapp, or also added to the container installation?
> Depending on the answers, it's relatively easy (after understanding 
> tomcat class loaders and log4j default configuration mechanisms) to 
> explain, which config gets evaluated and why.
> Regards,
> Rainer
> Marc Rameder wrote:
>> Hi
>> I have a problem with tomcat 5.5.20. My application uses log4j 1.2.9 and
>> am sure that all my implementation is correct because I uses JUnit and
>> logging works fine with it. However, Tomcat loads my so
> the
>> configuration of the web.xml should be right. 
>> I know that because the log file is created but it contains no entries.
>> Moreover my is used in other projects without tomcat and
>> works file. 
>> Is there a special configuration of the tomcat?
>> Thanks
>> marc

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