I am using log4j for loggin purpose in my application. Since now to configure the logging i was using the following code :
LogManager.resetConfiguration();
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("log4j.properties");
Properties props= new Properties();
props.load(stream);
PropertyConfigurator.configure(props);
But the problem with this was , that whenever i wanted to change the logging level during the process, i had to restart the server. So i changed the code to :-
LogManager.resetConfiguration();
PropertyConfigurator.configureAndWatch(("log4j.properties", 900000L);
this code ideally should help to re-load the log4j.properties file after the time specified, which i have mentioned as 15 minutes. But still the code is not working
Am i missing somthing during the code?
Regards.
configureAndWatch()watches files. Not resources in the classpath.