Log4j Logging Question (Urgent)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jag_Bharani
Posted On:   Friday, August 13, 2004 02:30 PM

We have few different applications and trying to use log4j for all of them.Since all the apps are on one single cluster(6 servers clustered together), we are using one and only one log4j.properties file for all these apps.Because of this , all the log messages from different apps are going to one single log file.Also we couldn't be able control logging at each application level.to We wanted different log files for different apps. Following are my questions : 1. How can we do this by a standalone implementation of log4j.What I mean by this is , log4j.jar is not a part of individual application ear files ? 2. Will log4j works well in a clustered environemnts?Do we need to make any code/configuration changes for this? Appreciate for an ear   More>>

We have few different applications and trying to use log4j for all of them.Since all the apps are on one single cluster(6 servers clustered together), we are using one and only one log4j.properties file for all these apps.Because of this , all the log messages from different apps are going to one single log file.Also we couldn't be able control logging at each application level.to We wanted different log files for different apps. Following are my questions :
1. How can we do this by a standalone implementation of log4j.What I mean by this is , log4j.jar is not a part of individual application ear files ?
2. Will log4j works well in a clustered environemnts?Do we need to make any code/configuration changes for this?

Appreciate for an early reply.


Please use html tags to format code blocks.

   <<Less

Re: Log4j Logging Question (Urgent)

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, August 16, 2004 09:29 PM

I think you really are supposed to put a copy of log4j.jar into each web application's WEB-INF/lib directory. If they are in WAR files, put the jar in the war file. If they are in EAR files, put the jar in the WAR file inside the EAR file.


For the rest, for EJB's and other Jar's outside of WAR's, I think we also put a separate copy of log4j.jar in the top-level directory of each EJB Jar file.


I think there are some articles on what to watch out for, re classloader problems when using log4j in EJB's, and someone posted the URL's here sometime ago, so search/browse through old postings here for them (under this Log4j topic).



Also you know (or you should know!) that in one single log4j config file, you can define multiple Appenders, say RollingFileAppenders writing out to different files, and you can attach different loggers to different Appenders.

About | Sitemap | Contact