I am using log4j for the purpose of loggin in my application. Since now I used the following code to configure logging:
LogManager.resetConfiguration();
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("log4j.properties");
Properties props= new Properties();
props.load(stream);
PropertyConfigurator.configure(props);
But the problem was that whenever I wanted to change the level of logging during the process, I had to restart the server. So I changed the code to: -
LogManager.resetConfiguration();
PropertyConfigurator.configureAndWatch(("log4j.properties", 900000L);
this code should ideally help reload the log4j.properties file after the specified time, which I mentioned as 15 minutes, has expired. But the code is not working yet
Am I missing during code?
Sincerely.
source
share