• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading multiple log4j.xml files

 
Jeff Strike
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20735
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I did. It works and it's a lot simpler than messing with the classloader.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic