ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Understanding Classloaders: log4j in a J2EE Environment
Subject:   At first sight I agree, but.......
Date:   2003-04-08 10:46:30
From:   anonymous2
I'm not sure putting the log4j in the .ear file is always the best solution. It seems the obvious thing to do as all the code for your app is in one location.


My problem is to do with the configuration of Log4j and not the classloading. If the config file is also in the .ear then it is pretty much impossible to change the logging config at runtime without re-deploying the application. You can't take advantage of methods like DOMConfigurator.prepareAndWatch(...) as you can't change the xml config file. It's hidden in the ear file.


Another issue is if you wish to initialise log4j yourself and not rely on the default initialisation. Where should you put the code for this one time initialisation? Certainly not in an EJB method.


How have people resolved these issues?


1 to 1 of 1
  1. At first sight I agree, but.......
    2003-04-11 05:30:55  gvix [View]

1 to 1 of 1