log4j.xml配置做到修改后不重启程序
在org.springframework.util.Log4jConfigurer已经提供了支持,其实
Log4jConfigurer类主要是还是依赖了log4j框架里面的类
//xml配置
DOMConfigurator.configureAndWatch(file.getAbsolutePath(), refreshInterval);
//properties配置
PropertyConfigurator.configureAndWatch(file.getAbsolutePath(), refreshInterval);
实现上底层log4j开始了一个XMLWatchdog线程,该线程启动后只有在VM退出的时候才退出
线程不断扫描文件是否修改过(lastModified)修改过,则重新配置log,