I'm debugging a custom log4net Appender
that I've written. My setup uses this standard PatternLayout
in my config file:
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout
In my Append()
method implementation if I call RenderLoggingEvent()
it returns a properly formatted message. The loggingEvent's Renderedmessage
, however, only contains the %message
bit.
RenderLoggingEvent()
returns:
"2015-06-09 14:09:37,382 [Main Thread] INFO MyConsole.Program [(null)] - Thread test\r\n"
loggingEvent.RenderedMessage
contains:
"Thread test"
Is this how RenderedMessage
is supposed to work?
I need to render the message outside of the Appender
so I'd rather not use its RenderLoggingEvent()
method. Is there a more direct way to get the rendered message from the LoggingEvent
instance?