title: FileNotFoundException (Logback) while starting app
body: <p>When running <code>SpringBoot 2.0.3</code> app on tomcat <code>8.5.0</code> i get following error:</p>
  
  <blockquote>
    <p>ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - 
    openFile(C:\Program Files\Apache Software Foundation\Tomcat
    9.0\temp/spring.log,true) call failed.  java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp\spring.log
    (Access is denied)</p>
  </blockquote>
  
  <p><code>logback-spring.xml</code> from this module is as follow:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
  
      &lt;springProperty scope="context" name="springAppName" source="spring.application.name"/&gt;
      &lt;include resource="org/springframework/boot/logging/logback/base.xml"/&gt;
      &lt;include resource="logback-json.xml"/&gt;
      &lt;property name="LOG_PATTERN"
                value="%date{yyyy-MM-dd HH:mm:ss.SSS}|${springAppName}|[%X{X-B3-TraceId:-},%X{X-B3-SpanId:-},%X{X-Span-Export:-}]|%thread|%.-1level|%logger{10}|%msg%n"/&gt;
  
      &lt;appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;${LOG_PATTERN}&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;file&gt;${catalina.base}/logs/${springAppName}.log&lt;/file&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"&gt;
              &lt;fileNamePattern&gt;${catalina.base}/logs/${springAppName}-%d{yyyy-MM-dd}.%i.log.zip&lt;/fileNamePattern&gt;
              &lt;maxFileSize&gt;200MB&lt;/maxFileSize&gt;
          &lt;/rollingPolicy&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;${LOG_PATTERN}&lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;logger name="pl.X" level="debug"/&gt;
  
      &lt;logger name="jdbc.sqltiming" level="info"/&gt;
  
      &lt;appender name="ASYNC_REQUEST_RESPONSE_JSON_LOG" class="ch.qos.logback.classic.AsyncAppender"&gt;
          &lt;appender-ref ref="REQUEST_RESPONSE_JSON_LOG"/&gt;
      &lt;/appender&gt;
  
      &lt;appender name="ASYNC_ROLLING" class="ch.qos.logback.classic.AsyncAppender"&gt;
          &lt;appender-ref ref="ROLLING"/&gt;
      &lt;/appender&gt;
      &lt;appender name="ASYNC_SERVER_JSON_LOG" class="ch.qos.logback.classic.AsyncAppender"&gt;
          &lt;appender-ref ref="SERVER_JSON_LOG"/&gt;
      &lt;/appender&gt;
      &lt;logger name="somePakaes.trace.XLoggingFilter" additivity="false" level="DEBUG"&gt;
          &lt;appender-ref ref="ASYNC_REQUEST_RESPONSE_JSON_LOG"/&gt;
      &lt;/logger&gt;
      &lt;root level="WARN"&gt;
          &lt;appender-ref ref="ASYNC_ROLLING"/&gt;
          &lt;appender-ref ref="ASYNC_SERVER_JSON_LOG"/&gt;
          &lt;appender-ref ref="CONSOLE"/&gt;
      &lt;/root&gt;
  </code></pre>
  
  <p></p>
  
  <p>And here is <code>logback-json.xml</code> that above files refers to:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;included&gt;
      &lt;springProperty scope="context" name="springAppName" source="spring.application.name"/&gt;
  
      &lt;appender name="SERVER_JSON_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;file&gt;${catalina.base}/logs/${springAppName}.json&lt;/file&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"&gt;
              &lt;fileNamePattern&gt;${catalina.base}/logs/${springAppName}-%d{yyyy-MM-dd}.%i.json.zip&lt;/fileNamePattern&gt;
              &lt;maxFileSize&gt;200MB&lt;/maxFileSize&gt;
              &lt;maxHistory&gt;2&lt;/maxHistory&gt;
          &lt;/rollingPolicy&gt;
          &lt;encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"&gt;
              &lt;providers&gt;
                  &lt;pattern&gt;
                      &lt;pattern&gt;
                          {
                          "date":"%date",
                          "severity": "%level",
                          "service": "${springAppName}",
                          "trace": "%X{X-B3-TraceId:-}",
                          "span": "%X{X-B3-SpanId:-}",
                          "parent": "%X{X-B3-ParentSpanId:-}",
                          "exportable": "%X{X-Span-Export:-}",
                          "pid": "${PID:-}",
                          "thread": "%thread",
                          "class": "%logger{26}",
                          "message": "%message",
                          "ex": "%ex"
                          }
                      &lt;/pattern&gt;
                  &lt;/pattern&gt;
              &lt;/providers&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;logger name="org.springframework.cloud.sleuth.instrument.web.TraceFilter" level="error"/&gt;
      &lt;logger name="org.springframework.cloud.sleuth.instrument.web.TraceHandlerInterceptor" level="error"/&gt;
  
  
      &lt;appender name="REQUEST_RESPONSE_JSON_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;file&gt;${catalina.base}/logs/${springAppName}_request_response.json&lt;/file&gt;
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"&gt;
              &lt;fileNamePattern&gt;${catalina.base}/logs/${springAppName}_request_response-%d{yyyy-MM-dd}.%i.json.zip&lt;/fileNamePattern&gt;
              &lt;maxFileSize&gt;200MB&lt;/maxFileSize&gt;
              &lt;maxHistory&gt;2&lt;/maxHistory&gt;
          &lt;/rollingPolicy&gt;
  
          &lt;encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"&gt;
              &lt;providers&gt;
                  &lt;pattern&gt;
                      &lt;pattern&gt;
                          {
                          "date":"%date",
                          "service": "${springAppName}",
                          "severity": "%level",
                          "trace": "%X{X-B3-TraceId:-}",
                          "span": "%X{X-B3-SpanId:-}",
                          "parent": "%X{X-B3-ParentSpanId:-}",
                          "pid": "${PID:-}",
                          "thread": "%thread",
                          "message": "%message"
                          }
                      &lt;/pattern&gt;
                  &lt;/pattern&gt;
              &lt;/providers&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  &lt;/included&gt;
  </code></pre>
  
  <p>But the problem disappears when running InteliJ as an <code>admin</code>.</p>