Apache log4net� SDK Documentation - Microsoft .NET Framework 4.0

EventLogAppender Class

Writes events to the system event log.

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


public�class�EventLogAppender : 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.


The appender will fail if you try to write using an event source that doesn't exist unless it is running with local administrator privileges. See also http://logging.apache.org/log4net/release/faq.html#trouble-EventLog

The EventID of the event log entry can be set using the EventID property (Properties) on the LoggingEvent.

The Category of the event log entry can be set using the Category property (Properties) on the LoggingEvent.

There is a limit of 32K characters for an event log message

When configuring the EventLogAppender a mapping can be specified to map a logging level to an event log entry type. For example:

    <level value="ERROR" />
    <eventLogEntryType value="Error" />
    <level value="DEBUG" />
    <eventLogEntryType value="Information" />

The Level is the standard log4net logging level and eventLogEntryType can be any value from the EventLogEntryType enum, i.e.:


Namespace: log4net.Appender

Assembly: log4net (in log4net.dll)

See Also

EventLogAppender Members | log4net.Appender Namespace