AppenderSkeleton RenderLoggingEvent Method (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 string RenderLoggingEvent(
    	LoggingEvent loggingEvent
    )

    Protected Function RenderLoggingEvent (
    	loggingEvent As LoggingEvent
    ) As String

    protected:
    String^ RenderLoggingEvent(
    	LoggingEvent^ loggingEvent
    )

    member RenderLoggingEvent :
            loggingEvent : LoggingEvent -> string

#### Parameters

loggingEvent
  Type: log4net.Core
  LoggingEvent
  The event to render.

#### Return Value

Type: String
The event rendered as a string.
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.

Where possible use the alternative version of this method [M:RenderLoggingEvent(TextWriter,LoggingEvent)]. That method streams the rendering onto an existing Writer which can give better performance if the caller already has a TextWriter open and ready for writing.

See Also

#### Reference

AppenderSkeleton Class
RenderLoggingEvent Overload
log4net.Appender Namespace