title: Play framework ERROR in ch.qos.logback.core.FileAppender[FILE] - Failed to create parent directories
body: <p>In my java play framework (version 2.8) project, after deploying in kubernetes production enviroment, I need to put the logs in an external container folder, but with this current play framework version seems that is impossible to create and append file for permissions reason.</p>
  <p>This is my configuration in logback.xml</p>
  <pre><code>  &lt;appender name=&quot;FILE&quot; class=&quot;ch.qos.logback.core.FileAppender&quot;&gt;
      &lt;file&gt;${application.home:-.}/logs/application.log&lt;/file&gt;
      &lt;encoder&gt;
        &lt;charset&gt;UTF-8&lt;/charset&gt;
        &lt;pattern&gt;
          %d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{akkaSource}) %msg%n
        &lt;/pattern&gt;
      &lt;/encoder&gt;
    &lt;/appender&gt;
  
    &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;
      &lt;withJansi&gt;true&lt;/withJansi&gt;
      &lt;encoder&gt;
        &lt;charset&gt;UTF-8&lt;/charset&gt;
        &lt;pattern&gt;
          %d{yyyy-MM-dd HH:mm:ss} %highlight(%-5level) %cyan(%logger{36}) %magenta(%X{akkaSource}) %msg%n
        &lt;/pattern&gt;
      &lt;/encoder&gt;
    &lt;/appender&gt;
  </code></pre>
  <p>This is the error:</p>
  <pre><code>ERROR in ch.qos.logback.core.FileAppender[FILE] - Failed to create parent directories for [/opt/docker/logs/application.log]
  19:41:09,843 |-ERROR in ch.qos.logback.core.FileAppender[FILE] - openFile(/opt/docker/logs/application.log,true) call failed. java.io.FileNotFoundException
  </code></pre>
  <p>I add others instruction to my application.conf but I receive permission error during deploy:</p>
  <pre><code>dockerCommands ++= Seq(
    ExecCmd(&quot;RUN&quot;, &quot;mkdir&quot;, &quot;-p&quot;, &quot;/opt/docker/logs/&quot;),
    ExecCmd(&quot;RUN&quot;, &quot;chmod&quot;, &quot;+w&quot;, &quot;-R&quot;, &quot;/opt/docker/logs/&quot;)
  )
  </code></pre>
  <p>Any suggestions?
  thanks</p>