The system property [logback.configurationFile] needs to be passed with the proper logback file path to override the default configuration.
java -Dlogback.configurationFile=/opt/logback.xml -jar /opt/restApp1.0.jar
If you want the logback-classic to automatically refresh the changes, then the scan attribute should be passed as true. otherwise it would not be reloaded. We have to manually restart the server/application. This attribute is available in the root node[configuration]
<configuration scan="true"> ... ... </configuration> By default logback-classic will scan the changes every one minute, but if we want to change this then we have to add another attribute scanPeriod with the time interval and the unit as below.
<configuration scan="true" scanPeriod="30 seconds"> ... ... </configuration>