Logback does not restart the program to reload the configuration file

The following configuration means not restarting the service and reloading the log configuration file after the specified time

 

logback.xml

 

<configuration  scan="true" scanPeriod="30 seconds">
....
</configuration>

 

 

 

 

 

 

 

Configuration instructions:

scan: Set to true, which means that the log configuration file will be reloaded within the specified time

scanPeriod: When scan=true, the log configuration file will be reloaded within the specified unit time, the default is to reload once every minute.

Configuration instructions for scanPeriod:

Time unit: milliseconds, seconds, minutes, hours

eg:

5分钟: <configuration  scan="true" scanPeriod="5 minutes">

1小时:  <configuration  scan="true" scanPeriod="1 hours">

 

 

 

Official website: https://logback.qos.ch/manual/configuration.html#autoScan

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326529525&siteId=291194637