title: How to trace SQL requests for H2 in-memory databases?
body: <p>How can I trace SQL requests for H2 in-memory embedded databases?</p>
  
  <p>The documentation says the trace file is located in the same directory as the database file, but for in-memory embedded database I have no database directory (under Windows).</p>
  
  <p>I tried to redirect traces to a given file with slf4j/logback by using</p>
  
  <pre><code>TRACE_LEVEL_FIle=4;TRACE_LEVEL_SYSTEM_OUT=3
  </code></pre>
  
  <p>in the database URL and the following logback.xml config file but with no luck:</p>
  
  <pre><code>&lt;configuration scan="true"&gt;
    &lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;file&gt;mylogfile.log&lt;/file&gt;
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
        &lt;fileNamePattern&gt;%d{yyyyMMdd}_mylogfile.log&lt;/fileNamePattern&gt;
      &lt;/rollingPolicy&gt;
      &lt;encoder&gt;
        &lt;pattern&gt;%date{yyyyMMdd HH:mm:ss} %contextName[%thread] %level %logger{0} - %msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
    &lt;/appender&gt;
  
    &lt;logger name="com.myapp" level="WARN"&gt;
      &lt;appender-ref ref="FILE" /&gt;
    &lt;/logger&gt;
  
    &lt;logger name="h2database" level="TRACE"&gt;
      &lt;appender-ref ref="FILE" /&gt;
    &lt;/logger&gt; --&gt;
  
    &lt;root level="WARN"&gt;
      &lt;appender-ref ref="FILE" /&gt;
    &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>My logback config file works correctly for other logs.</p>
  
  <p>Any idea?</p>