AppenderSkeleton RenderLoggingEvent Method (TextWriter, LoggingEvent) | Apache log4net™ SDK Documentation

Renders the LoggingEvent to a string.

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    protected void RenderLoggingEvent(
    	TextWriter writer,
    	LoggingEvent loggingEvent
    )

    Protected Sub RenderLoggingEvent (
    	writer As TextWriter,
    	loggingEvent As LoggingEvent
    )

    protected:
    void RenderLoggingEvent(
    	TextWriter^ writer,
    	LoggingEvent^ loggingEvent
    )

    member RenderLoggingEvent :
            writer : TextWriter *
            loggingEvent : LoggingEvent -> unit

#### Parameters

writer
  Type: System.IO
  TextWriter
  The TextWriter to write the formatted event to
loggingEvent
  Type: log4net.Core
  LoggingEvent
  The event to render.

Remarks

Helper method to render a LoggingEvent to a string. This appender must have a Layout set to render the loggingEvent to a string.

If there is exception data in the logging event and the layout does not process the exception, this method will append the exception text to the rendered string.

Use this method in preference to [M:RenderLoggingEvent(LoggingEvent)] where possible. If, however, the caller needs to render the event to a string then [M:RenderLoggingEvent(LoggingEvent)] does provide an efficient mechanism for doing so.

See Also

#### Reference

AppenderSkeleton Class
RenderLoggingEvent Overload
log4net.Appender Namespace