Table of Contents

Class ExceptionLayout

Namespace
log4net.Layout
Assembly
log4net.dll

A Layout that renders only the Exception text from the logging event

public class ExceptionLayout : LayoutSkeleton, ILayout, IOptionHandler
Inheritance
ExceptionLayout
Implements
Inherited Members

Remarks

A Layout that renders only the Exception text from the logging event.

This Layout should only be used with appenders that utilize multiple layouts (e.g. AdoNetAppender).

Constructors

ExceptionLayout()

Default constructor

public ExceptionLayout()

Remarks

Constructs a ExceptionLayout

Methods

ActivateOptions()

Activate component options

public override void ActivateOptions()

Remarks

Part of the IOptionHandler component activation framework.

This method does nothing as options become effective immediately.

Format(TextWriter, LoggingEvent)

Gets the exception text from the logging event

public override void Format(TextWriter writer, LoggingEvent loggingEvent)

Parameters

writer TextWriter

The TextWriter to write the formatted event to

loggingEvent LoggingEvent

the event being logged

Remarks

Write the exception string to the TextWriter. The exception string is retrieved from LoggingEvent.GetExceptionString().