aspose file tools*
The moose likes Java in General and the fly likes Loading multiple log4j.xml files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Loading multiple log4j.xml files" Watch "Loading multiple log4j.xml files" New topic
Author

Loading multiple log4j.xml files

Jeff Strike
Greenhorn

Joined: May 19, 2008
Posts: 15
I have 2 war files, a.war and b.war, both deployed in an ear file. (They need to share session data) Each war has it's own log4j jar and xml file yet only the xml file from a.war is loaded. Is there a way I can have both loaded or is it better to combine the xml files and put them at the ear level instead of each war? We may be adding other war files to the ear so log4j.xml file may be changing.

Thanks.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

It's better to combine them into one file at the "ear" level. At least, that works and what you're doing now doesn't work, so that's better in my book.

Depending on what web application server you are using, it might be possible to arrange things so that each "war" ran in a separate class loader (this is what you would have to do).
Jeff Strike
Greenhorn

Joined: May 19, 2008
Posts: 15
That's what I did. It works and it's a lot simpler than messing with the classloader.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Loading multiple log4j.xml files