I have a Java web application that uses the SLF4J registration facade. Today we use the Log4J implementation under it (although we are considering switching to Logback). Log4J is currently configured through the log4j.xml configuration file, which is placed at the root of our class path.
In any case, we use JNDI to configure other aspects of our application, so I know very well how to install this and pull a string from JNDI into the Spring configuration file.
However, I do not understand how to create a Log4J application from the Spring configuration file. Even better, is it possible to fully configure Log4J through Spring and generally skip the log4j.xml configuration file? I hope I do not need to do this programmatically.
I found a Spring class called Log4jWebConfigurer, but this requires the WAR to start exploding (I don’t want me to be able to help it), and also that the log file is in the web application directory (definitely don’t want it).
Hdave source
share