Existen varias formas de cambiar la ruta donde se encuentra el fichero log4j.properties (o log4j.xml).
Ahí van algunas:
· Con la variable de Sistema: log4j.configuration
-Dlog4j.configuration=file:///path/to/log4j.properties
· En aplicaciones Web con init-param:
<init-param>
<param-name>log4j-init-file</param-name>
<param-value>WEB-INF/log4j.properties</param-value>
</init-param>
· Usando el PropertyConfigurer
PropertyConfigurator.configure("log4j.properties");

Deja un comentario