title: Custom Logback Appender - Prepending file header and making it rollover
body: <p>The functionality that I need is <strong>writing a header line</strong> at the beginning of the configured log file. The log file should, in addition, <strong>get rolled over</strong> based on a time pattern (I'm talking logback 1.0.7).</p>
  
  <p>So, I'm thinking of writing an <strong>Appender</strong> - although I'm not sure whether it's not a custom <strong>Layout</strong> that I actually need. </p>
  
  <p><em>1) Appender</em> </p>
  
  <p>Per logback's documentation, the right approach is to extend <code>AppenderSkeleton</code>, but then how would I combine this with the <code>RollingFileAppender</code> (to make the file rollover?) </p>
  
  <p>On the other hand, if I extend <code>RollingFileAppender</code>, what method do I override to just decorate the existing functionality? How do I tell it to write that particular String only at the beginning of the file? </p>
  
  <p><em>2) Layout</em></p>
  
  <p>Analogously, the approach seems to be extending <code>LayoutBase</code>, and providing an implementation for <code>doLayout(ILoggingEvent event)</code>. 
  But again, I don't know how to just decorate the behaviour - just adding a new line in the file, rather than disrupting its functionality (because I still want the rest of the logs to show up properly).</p>
  
  <p>The <code>getFileHeader()</code> in <code>LayoutBase</code> looks promising, but how do I use it? Is it even intended to be overridden by custom layouts? (probably yes, since it's part of the Layout interface, but then how?) </p>
  
  <p>Thank you! </p>