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.


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.


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:

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

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

Based on the ColoredConsoleAppender


Namespace: log4net.Appender

Assembly: log4net (in log4net.dll)

See Also

ManagedColoredConsoleAppender Members | log4net.Appender Namespace