XmlLayoutBase Format Method (TextWriter, LoggingEvent) | Apache log4net™ SDK Documentation

Produces a formatted string.

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

C#
VB
C++
F#
Copy

    public override void Format(
    	TextWriter writer,
    	LoggingEvent loggingEvent
    )

    Public Overrides Sub Format (
    	writer As TextWriter,
    	loggingEvent As LoggingEvent
    )

    public:
    virtual void Format(
    	TextWriter^ writer,
    	LoggingEvent^ loggingEvent
    ) override

    abstract Format :
            writer : TextWriter *
            loggingEvent : LoggingEvent -> unit
    override Format :
            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 being logged.

#### Implements

ILayout
Format(TextWriter, LoggingEvent)
Remarks

Format the LoggingEvent and write it to the TextWriter.

This method creates an XmlTextWriter that writes to the writer. The XmlTextWriter is passed to the FormatXml(XmlWriter, LoggingEvent) method. Subclasses should override the FormatXml(XmlWriter, LoggingEvent) method rather than this method.

See Also

#### Reference

XmlLayoutBase Class
Format Overload
log4net.Layout Namespace