title: Logback RollingFileAppender FileNotFoundException
body: <p>I am using <code>logback</code> in my <code>spring-boot</code> project. When we deploy the app in <code>PROD</code> environment, deployment is failed with below exceptions. Before PROD, we deployed the app in lower environments, we did not see any issues. Can someone please throw some light?</p>
  <p>In <code>logback.xml</code> we have specified the log path as <code>/app/tomcatprofile/micro001/logs/sc-erp-security-permissions-check.log</code> but from logs below, logpath is set as <code>/app/tomcatprofile/micro001/logs</code>.</p>
  <p>Also attached our <code>logback.xml</code>.</p>
  <pre><code>15:54:22,305 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /app/tomcatprofile/micro001/logs
  15:54:22,305 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/app/tomcatprofile/micro001/logs]
  15:54:22,305 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/app/tomcatprofile/micro001/logs,true) call failed. java.io.FileNotFoundException: /app/tomcatprofile/micro001/logs (Is a directory)
      at java.io.FileNotFoundException: /app/tomcatprofile/micro001/logs (Is a directory)
      at  at java.io.FileOutputStream.open0(Native Method)
      at  at java.io.FileOutputStream.open(FileOutputStream.java:270)
      at  at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:213)
      at  at ch.qos.logback.core.recovery.ResilientFileOutputStream.&lt;init&gt;(ResilientFileOutputStream.java:26)
      at  at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:204)
      at  at ch.qos.logback.core.FileAppender.start(FileAppender.java:127)
      at  at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:100)
      at  at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
      at  at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
      at  at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
      at  at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
      at  at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
      at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
      at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
      at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
      at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
      at  at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
      at  at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
      at  at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
      at  at org.slf4j.impl.StaticLoggerBinder.&lt;clinit&gt;(StaticLoggerBinder.java:55)
      at  at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
      at  at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
      at  at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
      at  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
      at  at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
      at  at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
      at  at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273)
      at  at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86)
      at  at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
      at  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5151)
      at  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
      at  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      at  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      at  at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at  at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  <p>Logback.xml file</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  
  &lt;configuration&gt;
  
      &lt;property name=&quot;FILE_PATH&quot; value=&quot;${catalina.base}/logs/sc-erp-security-permissions-check.log&quot; /&gt;
  
      &lt;appender name=&quot;consoleAppender&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;
          &lt;encoder&gt;
              &lt;Pattern&gt;%d [%t] %-5p %c - %X{TransactionId} - %m%n&lt;/Pattern&gt;
          &lt;/encoder&gt;
          &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;
              &lt;level&gt;TRACE&lt;/level&gt;
          &lt;/filter&gt;
      &lt;/appender&gt;
  
      &lt;appender name=&quot;mainAppender&quot;
                class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;
          &lt;file&gt;${FILE_PATH}&lt;/file&gt;
          &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.TimeBasedRollingPolicy&quot;&gt;
              &lt;fileNamePattern&gt;${FILE_PATH}.%d{yyyy-MM-dd}.log&lt;/fileNamePattern&gt;
              &lt;maxHistory&gt;30&lt;/maxHistory&gt;
          &lt;/rollingPolicy&gt;
          &lt;append&gt;true&lt;/append&gt;
          &lt;encoder&gt;
              &lt;Pattern&gt;%d [%t] %-5p %c - %X{TransactionId} - %m%n&lt;/Pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;logger name=&quot;com.adp.smartconnect&quot; additivity=&quot;false&quot;&gt;
          &lt;level value=&quot;DEBUG&quot; /&gt;
          &lt;appender-ref ref=&quot;mainAppender&quot; /&gt;
          &lt;appender-ref ref=&quot;consoleAppender&quot; /&gt;
      &lt;/logger&gt;
  
      &lt;include resource=&quot;org/springframework/boot/logging/logback/base.xml&quot;/&gt;
  
      &lt;logger name=&quot;org.springframework.web&quot; level=&quot;INFO&quot;/&gt;
      &lt;logger name=&quot;org.springframework.boot&quot; level=&quot;WARN&quot;/&gt;
      &lt;logger name=&quot;org.springframework.jmx&quot; level=&quot;WARN&quot;/&gt;
      &lt;logger name=&quot;com.adp.smartconnect.commons&quot; level=&quot;WARN&quot; /&gt;
      &lt;logger name=&quot;springfox&quot; level=&quot;WARN&quot;/&gt;
  
      &lt;logger name=&quot;org.springframework.ws.client.MessageTracing.sent&quot; level=&quot;INFO&quot;/&gt;
      &lt;logger name=&quot;org.springframework.ws.client.MessageTracing.received&quot; level=&quot;INFO&quot;/&gt;
      &lt;logger name=&quot;org.springframework.ws.server.MessageTracing&quot; level=&quot;INFO&quot;/&gt;
  
      &lt;root&gt;
          &lt;level value=&quot;INFO&quot; /&gt;
          &lt;appender-ref ref=&quot;mainAppender&quot; /&gt;
          &lt;appender-ref ref=&quot;consoleAppender&quot; /&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>