When default configuration does not exists (logback.groovy, logback-test.xml, logback.xml), LogBack will read system property to get the configuration file location:

java -Dlogback.configurationFile=/path/to/config.xml com.stefanauwyang.ApplicationClass


LogBack can be configured to automatically detect the change in configuration file:

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

Without the scanPeriod attribute, default period 60 seconds will be set automatically.

LogBack provides a servlet to check the LogBack logging status:


We can also print LogBack status to console by configuring this listener through Java code.

LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); 
StatusManager statusManager = lc.getStatusManager();
OnConsoleStatusListener onConsoleListener = new OnConsoleStatusListener();

… or from config file …

  <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />

Leave a reply


<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>