I have a RollingFileAppender that rolls over the log file when it reaches a specified file size. This works great.
Is there a way to have log4net insert a header at the top of each newly created log file? Alternatively, is there a way to be notified by log4net when a roll over occurs so that I can write this header myself?
This seems to work:
<layout type="log4net.Layout.PatternLayout">
<header value="[Header] " />
<conversionPattern value=" ... " />
</layout>
Though it will also write the header if you re-start the application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With