title: Logback TimeBasedRollingPolicy with spring boot
body: <p>I wrote a TimeBasedRollingPolicy <em>logback.xml</em>, and while the log file is created succesfully, it seems to be reading it from the <em>application.properties</em> instead. Here is my setup:</p>
  
  <p><strong>logback.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
      &lt;include resource="org/springframework/boot/logging/logback/defaults.xml"/&gt;
      &lt;include resource="org/springframework/boot/logging/logback/console-appender.xml"/&gt;
  
      &lt;appender name="ROLLING-FILE"
                class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;${FILE_LOG_PATTERN}&lt;/pattern&gt;
          &lt;/encoder&gt;
          &lt;file&gt;${LOG_FILE}&lt;/file&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
              &lt;!-- daily rollover --&gt;
              &lt;fileNamePattern&gt;${LOG_FILE}-%d{yyyy-MM-dd}.log&lt;/fileNamePattern&gt;
          &lt;/rollingPolicy&gt;
      &lt;/appender&gt;
  
      &lt;root level="INFO"&gt;
          &lt;appender-ref ref="CONSOLE"/&gt;
          &lt;appender-ref ref="ROLLING-FILE"/&gt;
      &lt;/root&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>application.properties</strong></p>
  
  <pre><code>logging.path=/path/to/log/folder/
  logging.file=${logging.path}myLog
  logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
  </code></pre>
  
  <p>When I run my application, the log is successfully saved in the correct path, but only as <em>myLog</em>. I would want it to be appended with the date (as in the logback.xml). Note I do want to keep taking the <em>logging.path</em> and <em>logging.file</em> from the <em>application.properties</em> because I have multiple depending on the environment.</p>
  
  <p>Thanks</p>