Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does changing Log4j's log.properties require a restart?

Does changing Log4j's log.properties require a restart for the changes to take effect?

I'm trying to work out an issue in one of our systems and don't have the ability to restart the server process (OC4J in this case).

like image 741
Scott Bennett-McLeish Avatar asked Mar 27 '09 06:03

Scott Bennett-McLeish


2 Answers

Yes, since the configuration is loaded upon log4j startup which is loaded upon classloader startup.

like image 148
cherouvim Avatar answered Sep 18 '22 15:09

cherouvim


PropertyConfigurator.configureAndWatch(java.lang.String configFilename, long delay)

DOMConfigurator.configureAndWatch(java.lang.String configFilename, long delay)

We can use an appropriate delay (in milliseconds) to watch the config file for changes and reload the log4j properties (or xml) without restarting the server.

I am not sure how OC4J behaves, though.

like image 24
Vijay Dev Avatar answered Sep 19 '22 15:09

Vijay Dev