Add timing information to DEBUG logging on reconfiguration; handy to
capture how changes to a JDBC Appender for example affects
reconfiguration as acquiring database connection can be slow sometimes.
@@ -663,14 +663,17 @@ public class LoggerContext extends AbstractLifeCycle
*/
@Override
public synchronized void onChange(final Reconfigurable reconfigurable) {
+ final long startMillis = System.currentTimeMillis();
LOGGER.debug("Reconfiguration started for context {} ({})", contextName, this);
initApiModule();
final Configuration newConfig = reconfigurable.reconfigure();
if (newConfig != null) {
setConfiguration(newConfig);
- LOGGER.debug("Reconfiguration completed for {} ({})", contextName, this);
+ LOGGER.debug("Reconfiguration completed for {} ({}) in {} milliseconds.", contextName, this,
+ System.currentTimeMillis() - startMillis);
} else {
- LOGGER.debug("Reconfiguration failed for {} ({})", contextName, this);
+ LOGGER.debug("Reconfiguration failed for {} ({}) in {} milliseconds.", contextName, this,
+ System.currentTimeMillis() - startMillis);
}
}
