In a web-module you can place the log4j.properties on the classpath and log4j’s default initialization procedure will use the config, same in a standalone app, no problems here.
I have though trouble getting it to work in the ejb-module (javaee 1.4) in a EAR-app without programmatic configuration.
So my question is, where to put the log4j.properties file in a ejb-module to avoid programmatic config?
You should be able to put the Log4J configuration file into the root of the EJB JAR archive. This should work fine.
However I recommend to configure the logging globally for the application server our are using. This makes more sense and you won’t run into any configuration conflicts this way.