Apache log4net� SDK Documentation - Microsoft .NET Framework 4.0

ManagedColoredConsoleAppender Class

Appends colorful logging events to the console, using the .NET 2 built-in capabilities.

For a list of all members of this type, see ManagedColoredConsoleAppender Members.

System.Object
���log4net.Appender.AppenderSkeleton
������log4net.Appender.ManagedColoredConsoleAppender

[Visual�Basic]
Public�Class�ManagedColoredConsoleAppender
����Inherits�AppenderSkeleton
[C#]
public�class�ManagedColoredConsoleAppender : AppenderSkeleton

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

ManagedColoredConsoleAppender appends log events to the standard output stream or the error output stream using a layout specified by the user. It also allows the color of a specific type of message to be set.

By default, all output is written to the console's standard output stream. The Target property can be set to direct the output to the error stream.

When configuring the colored console appender, mappings should be specified to map logging levels to colors. For example:

[XML]
<mapping>
    <level value="ERROR" />
    <foreColor value="DarkRed" />
    <backColor value="White" />
</mapping>
<mapping>
    <level value="WARN" />
    <foreColor value="Yellow" />
</mapping>
<mapping>
    <level value="INFO" />
    <foreColor value="White" />
</mapping>
<mapping>
    <level value="DEBUG" />
    <foreColor value="Blue" />
</mapping>

The Level is the standard log4net logging level while ForeColor and BackColor are the values of ConsoleColor enumeration.

Based on the ColoredConsoleAppender

Requirements

Namespace: log4net.Appender

Assembly: log4net (in log4net.dll)

See Also

ManagedColoredConsoleAppender Members | log4net.Appender Namespace