log4net SDK Reference |

# XmlLayoutBase.Format Method

Produces a formatted string.

[Visual Basic]
Overrides Public Sub Format( _
ByVal writer As TextWriter, _
ByVal loggingEvent As LoggingEvent _
) _
Implements ILayout.Format
[C#]
public override void Format(
TextWriter writer,
LoggingEvent loggingEvent
);

#### Parameters

writer
  The TextWriter to write the formatted event to
loggingEvent
  The event being logged.

#### Implements

ILayout.Format

#### 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 method. Subclasses should override the FormatXml method rather than this method.

#### See Also

XmlLayoutBase Class | log4net.Layout Namespace