App.config looks like this:
<appender name="MemoryAppender" type="log4net.Appender.MemoryAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level - %message" />
</layout>
</appender>
Code looks like this:
foreach (var ev in events)
{
string msg = ev.RenderedMessage;
}
The string returned from ev.RenderedMessage is just the message, not the entire pattern. I’ve also tried using WriteRenderedMessage with a StringWriter and the result was the same. Is there a way to get the message with the pattern applied?
I found it 🙂