title: how to set dynamic log level in spring-mvc application?
body: <p>i want to set log level dynamic in my spring-mvc project.
  i want to set it dynamically so that without restarting server i can change log level.
  we can user apllication.propertes or get log level from database.
  my server contain too many logs of my application.
  i want to stop it and whenever i want to show logs i just change log level from database or any other way.
  But i want to achieve this process without re-starting my server.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
  &lt;property name="DEV_HOME" value="${catalina.base}/logs" /&gt;
  
  
      &lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;layout class="ch.qos.logback.classic.PatternLayout"&gt;
  
              &lt;Pattern&gt;
                  %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n
              &lt;/Pattern&gt;
  
          &lt;/layout&gt;
      &lt;/appender&gt;
      &lt;root level="error"&gt; 
          &lt;appender-ref ref="STDOUT" /&gt;
      &lt;/root&gt;
  
  
    &lt;appender name="FILE2" class="ch.qos.logback.core.FileAppender"&gt;
  
                   &lt;file&gt;${DEV_HOME}/SMPPIN.log&lt;/file&gt;
                 &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
        &lt;!-- daily rollover --&gt;
        &lt;fileNamePattern&gt;logFile.%d{yyyy-MM-dd}.log&lt;/fileNamePattern&gt;
  
        &lt;!-- keep 30 days' worth of history --&gt;
        &lt;maxHistory&gt;30&lt;/maxHistory&gt;
  
         &lt;timeBasedFileNamingAndTriggeringPolicy
              class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"&gt;
          &lt;!-- or whenever the file size reaches 100MB --&gt;
          &lt;maxFileSize&gt;1MB&lt;/maxFileSize&gt;
        &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
  
  
                    &lt;/rollingPolicy&gt;
          &lt;!-- &lt;param name="File" value="SMPPIN.log"/&gt; orther options ${user.home}
                   &lt;param name="MaxFileSize" value="15000KB"/&gt;
                   &lt;param name="MaxBackupIndex" value="30"/&gt;
                          &lt;param name="append" value="true" /&gt; --&gt;
  
      &lt;layout class="ch.qos.logback.classic.PatternLayout"&gt;
              &lt;Pattern&gt;
                  %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
              &lt;/Pattern&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
  
  
       &lt;logger name="SMPPINFO" level="info" additivity="false"&gt;
  
            &lt;appender-ref ref="FILE2"/&gt;         
          &lt;/logger&gt;
  
  &lt;/configuration&gt;
  </code></pre>