If log4j is used by various modules in the ear, it should be placed in a jar, which is placed in the ear lib directory. But this is not very convenient, since you will have to collect the ear and relocate it every time you change the level of the journal.
Another option is to put the log4j configuration file in a folder and add this folder to the ear class path. Most application servers provide this feature (for example, WebSphere). It is less portable, but more manageable: the configuration can be changed without reinstalling the ear.
source share