title: Logback layout presentation header at bottom of file?
body: <p>I'm programmatically configuring Logback and trying to set custom headers and footers to the log files when they rollover. To do this I've extended PatternLayout with a custom class:</p>
  
  <pre><code>class LogbackAdapterLayout extends PatternLayout {
  
    @Override
    public String getPresentationHeader() {
      return "head";
    }
  
    @Override
    public String getPresentationFooter() {
      return "foot";
    }
  }
  </code></pre>
  
  <p>But I end up with this:</p>
  
  <pre><code>head
  08:49:52.464 [main] TRACE com.example.test - Testing 0
  08:49:52.467 [main] TRACE com.example.test - Testing 1
  08:49:52.467 [main] TRACE com.example.test - Testing 2
  08:49:52.467 [main] TRACE com.example.test - Testing 3
  08:49:52.467 [main] TRACE com.example.test - Testing 4
  08:49:52.467 [main] TRACE com.example.test - Testing 5
  08:49:52.467 [main] TRACE com.example.test - Testing 6
  08:49:52.467 [main] TRACE com.example.test - Testing 7
  08:49:52.467 [main] TRACE com.example.test - Testing 8
  08:49:52.467 [main] TRACE com.example.test - Testing 9
  head
  foot
  </code></pre>
  
  <p>I'm using logback 1.1.3, configuring programmatically, wrapping the LogbackAdapterLayout with a LayoutWrappingEncoder, which is added to a RollingFileAppender (with SizeBasedTriggeringPolicy and FixedWindowRollingPolicy)</p>
  
  <p>Is there something I've configured incorrectly? Is there a way I can stop the header being at the bottom of the log file?</p>
  
  <p>EDIT: A little more information, the header at the top is added when the new log file is created, the "header" at the bottom is added on rollover, I can change LogbackAdapterLayout and run again and the new header string will appear at the bottom of the rolled over log, with the old one unchanged at the top.</p>