简体   繁体   中英

Can log4j be initialized in a EJB-module using the default initialization procedure?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM