You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Atul Gosain <ag...@cisco.com> on 2003/12/18 15:23:19 UTC

Multiple logging inside a single webapp

Hi
 
I have a situation like, a single webapp, but different modules inside a
single webapp. Each module is using its own logging using log4j. Each
one has a configuration file in Web-inf/classes and log4j.jar is inside
Web-inf/lib which they are configuring in their classes through
PropertConfigurator.
Some problems faced are
 
1. Now the problem is that after tomcat starting up. There's a module
which is appending on Console. but instead the logs are coming in
standard error. I am not getting why they are coming in stderr instead
of stdout logs.
 
2. Also .. i have one more query. i have the configuration file outside
the tomcat environment, but i have configured the file in
PropertyConfigurator, but the logging doesnt come in stdout of tomcat.
Is it because configuration file is not available to tomcat classloader.

 
3. There is another module who is logging inside its log file using
FileAppender. The problem is that the logging of all the modules start
coming in that file after the tomcat startup. They are not logging in
their separate log files. Is it that in Tomcat environment, in one
webapp, only one logging property comes into effect.
 
I hope many people must be using log4j inside tomcat with this kind of
environment.  Please guide.
 
Thanks
Atul
 
 

Re: Multiple logging inside a single webapp

Posted by Tom Eugelink <tb...@tbee.org>.
I had a lot of problems with something very similar. I resolve to 
writing a servlet which force-configures log4j.

Atul Gosain wrote:

> Hi
>  
> I have a situation like, a single webapp, but different modules inside a
> single webapp. Each module is using its own logging using log4j. Each
> one has a configuration file in Web-inf/classes and log4j.jar is inside
> Web-inf/lib which they are configuring in their classes through
> PropertConfigurator.
> Some problems faced are
>  
> 1. Now the problem is that after tomcat starting up. There's a module
> which is appending on Console. but instead the logs are coming in
> standard error. I am not getting why they are coming in stderr instead
> of stdout logs.
>  
> 2. Also .. i have one more query. i have the configuration file outside
> the tomcat environment, but i have configured the file in
> PropertyConfigurator, but the logging doesnt come in stdout of tomcat.
> Is it because configuration file is not available to tomcat classloader.
> 
>  
> 3. There is another module who is logging inside its log file using
> FileAppender. The problem is that the logging of all the modules start
> coming in that file after the tomcat startup. They are not logging in
> their separate log files. Is it that in Tomcat environment, in one
> webapp, only one logging property comes into effect.
>  
> I hope many people must be using log4j inside tomcat with this kind of
> environment.  Please guide.
>  
> Thanks
> Atul
>  
>  
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Multiple logging inside a single webapp

Posted by Tom Eugelink <tb...@tbee.org>.
I had a lot of problems with something very similar. I resolve to 
writing a servlet which force-configures log4j. You can have it, if you 
like.

Atul Gosain wrote:

> Hi
>  
> I have a situation like, a single webapp, but different modules inside a
> single webapp. Each module is using its own logging using log4j. Each
> one has a configuration file in Web-inf/classes and log4j.jar is inside
> Web-inf/lib which they are configuring in their classes through
> PropertConfigurator.
> Some problems faced are
>  
> 1. Now the problem is that after tomcat starting up. There's a module
> which is appending on Console. but instead the logs are coming in
> standard error. I am not getting why they are coming in stderr instead
> of stdout logs.
>  
> 2. Also .. i have one more query. i have the configuration file outside
> the tomcat environment, but i have configured the file in
> PropertyConfigurator, but the logging doesnt come in stdout of tomcat.
> Is it because configuration file is not available to tomcat classloader.
> 
>  
> 3. There is another module who is logging inside its log file using
> FileAppender. The problem is that the logging of all the modules start
> coming in that file after the tomcat startup. They are not logging in
> their separate log files. Is it that in Tomcat environment, in one
> webapp, only one logging property comes into effect.
>  
> I hope many people must be using log4j inside tomcat with this kind of
> environment.  Please guide.
>  
> Thanks
> Atul
>  
>  
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org