• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to have everything except my war in an ear use the same log4j.xml

 
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been reading over the RepositorySelector examples located on the wiki here:http://wiki.jboss.org/wiki/Wiki.jsp?page=Log4jRepositorySelector,
and I manged to use that to get my own war file's log4j.xml file picked up.

I obviously have other jars such as an ejb.jar and a common.jar that are also bundled up in the ear along with the war. How do I get everything else in the ear, other than the war (or I'd settle for everything including the war), to all use a common log4j.xml file that I can bundle in the ear?

Ideally I'd like to code one log4j.xml for my ear, but I'm not exactly sure how to go about setting this up? I'd need some way I guess when the first thing in the ear is accessed or when jboss is going to deploy it, that it loads some kind of init class that can load a RepositorySelector implementation. I'm not sure how to best accomplish that or if all my jars including my webapp would have access to the config loaded up. The wiki ebj.jar example shows an example of initializing the RepositorySelector from an EJB constructor. I certainly don't want to have to call init from every constructor that might be used in classes in my jars.

Thanks in advance for any help.
 
reply
    Bookmark Topic Watch Topic
  • New Topic