Scott,
Well, it turns out that JBoss 3.x comes bundled with Log4J 1.2.x. So it’s not necessary to include log4j-1.2.8.jar in the XFVM EAR, nor to point to it via manifest files.
So a better question would have been how to bundle Log4J into an EAR for an app server that doesn’t already integrate it, like OC4J. Anyway, the technique outlined above will work for OC4J, assuming you enable scanning of manifest files in WAR archives, a special option in OC4J 9.0.x.
The only remaining question is where to locate log4j.properties. JBoss puts it in the \conf directory of the server configuration set you are running. Then it accesses it from the Log4J configuration MBean like so:
<attribute name=”ConfigurationURL”>resource:log4j.xml</attribute>
I’m not sure why this URL magically resolves to the server home \conf directory. Anyone have an explanation?
For OC4J, if you locate log4j.properties in the server’s \applib directory, it will be on the application classpath, and Log4J will initialize itself as soon as any Logger class instance is loaded.
But it would be nice if you could put the log4j.properties file in the server’s \config directory and intialize it explicitly when your application starts up using a resource URL like JBoss does. I would be interested if anyone has a working example of this for OC4J, Orion or Oracle 9iAS.
-David