dcsimg
Configure multiple log files in single EAR
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   giridhar_challa
Posted On:   Friday, December 21, 2007 03:18 PM

How to configure multiple log files for single EAR which contains multiple WARs in Weblogic 92 environment? We have one EAR which contains 4 WARs and 1 JAR. The JAR is shared by each individual WAR. Each WAR is having its own log4j.properites file. Each web application (WAR) is loading the log4j.properties on load on start up. Each web application is creating its own log file. While writing the log messages all Web Applications (WARs) are writing into single (most recent) log files. This is happening in weblogic 92 environment. Our requirement is to write into individual log files for the assciated web application activity. Any suggestions from Gurus?    More>>

How to configure multiple log files for single EAR which contains multiple WARs in Weblogic 92 environment?



We have one EAR which contains 4 WARs and 1 JAR. The JAR is shared by each individual WAR.

Each WAR is having its own log4j.properites file.

Each web application (WAR) is loading the log4j.properties on load on start up.

Each web application is creating its own log file. While writing the log messages all Web Applications (WARs) are writing into single (most recent) log files.

This is happening in weblogic 92 environment.

Our requirement is to write into individual log files for the assciated web application activity.

Any suggestions from Gurus?

   <<Less

Re: Configure multiple log files in single EAR

Posted By:   Christopher_Koenigsberg  
Posted On:   Sunday, December 23, 2007 12:36 PM

I think your problem may be that log4j is sort of global for a single JVM; the configured log4j properties are static fields in the classes, I think, so you only get one set of configuration values across the whole JVM.



And WebLogic does weird nonstandard things sometimes, and perhaps it is just giving you one parent classloader for your entire EAR, encompassing all your WAR's. This may be something you can change in the admin GUI for the app server, maybe even some weblogic specific file in individual WAR's or in the EAR (I remember there used to be a "weblogic.xml" that you could put some weblogic-specific settings in).






So if you want different web applications writing to different log files, and if you are indeed stuck with one single copy of the log4j classes loaded and being shared by all the apps you've deployed together, then configure different loggers + appenders for the different files, and get them in the classes, by the fully qualified classnames, so that they are all distinct, across the entire EAR.
About | Sitemap | Contact