Reputation: 9966
I've configured the logback.xml file to be scanned every 5 seconds.
<configuration debug="true" scanPeriod="5 seconds">
...
Unfortunately this doesn't happen. What could go wrong?
The logback.xml
file resides on the classpath of the Tomcat server. It's not inside the web application. It's parsed correctly on startup. I'm starting the server with Eclipse.
Upvotes: 3
Views: 2246
Reputation: 9966
Besides scan
and scanPeriod
another aspect has to be considered as well:
Given that ReconfigureOnChangeFilter is invoked every time any logger is invoked, regardless of logger level, ReconfigureOnChangeFilter is absolutely performance critical. So much so that in fact, the check whether the scan period has elapsed or not, is too costly in itself. In order to improve performance, ReconfigureOnChangeFilter is in reality "alive" only once every N logging operations.
For more information see http://logback.qos.ch/manual/configuration.html#autoScan.
Upvotes: 2
Reputation: 1233
I think you forgot to set the scan
attribute:
<configuration scan="true" scanPeriod="30 seconds" >
...
</configuration>
Upvotes: 5