Possible Duplicate:
Dynamically Changing log4j log level
I have a jar file with a log4j properties file included. I tried to use
-Dlog4j.configuration=file:[filename]
to change the properties file at runtime using java, and it didn't work. I need to do this in a sh file Can anyone please tell me how to this? I also tried adding
-Dlog4j.defaultInitOverride=true
It's possible to override the log4j properties file at runtime. You may fall into this situation if you cann't :
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With