下面配置代表不重启服务,在指定时间后重载日志配置文件
logback.xml
<configuration scan="true" scanPeriod="30 seconds"> .... </configuration>
配置说明:
scan: 设置为true,代表会在指定的时间内重新加载日志配置文件
scanPeriod:当scan=true时,日志配置文件会在指定的单位时间内重新加载,默认是每分钟会重载一次。
scanPeriod的配置说明:
时间单位:milliseconds, seconds, minutes , hours
eg:
5分钟: <configuration scan="true" scanPeriod="5 minutes">
1小时: <configuration scan="true" scanPeriod="1 hours">
官网:https://logback.qos.ch/manual/configuration.html#autoScan
最后
以上就是优美柚子最近收集整理的关于Logback不重启程序重新加载配置文件的全部内容,更多相关Logback不重启程序重新加载配置文件内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复