How can I override the log4j properties file in my jar at runtime [duplicate] How can I override the log4j properties file in my jar at runtime [duplicate] unix unix

How can I override the log4j properties file in my jar at runtime [duplicate]


It's possible to override the log4j properties file at runtime. You may fall into this situation if you cann't :

  1. In your jar or somewhere in the code, the log4j system is initialised manually, e.g.

     URL url=loader.getResource(LOGGER_CONFIG_FILE) DOMConfigurator.configure(url);


Here's a good,step-by-step tutorial (with good screenshots!) that shows a couple of different alternatives for changing your log4j settings at runtime: