I want to initialize Log4j basically as the first thing in an EAR application, so that all other modules and classes can use the logger.
How can I do this?
I have an EAR with a WAR and multible EJB jars.
At the moment, I am initializing it in a init()
method of a Servlet, but I appear to have classes (e.g. Timers) that are loaded and initialized before that.
I need to initialize Log4j programmatically because I want to provide a custom location for the Log4j config file. I can't pass the file in via config parameters during app server or container startup.
The app server is Websphere 8.5, but a general standards-compliant solution is preferred.