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.

System.Object
���log4net.Appender.AppenderSkeleton
������log4net.Appender.EventLogAppender

[Visual�Basic]
Public�Class�EventLogAppender
����Inherits�AppenderSkeleton
[C#]
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.

Remarks

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:

[XML]
<mapping>
    <level value="ERROR" />
    <eventLogEntryType value="Error" />
</mapping>
<mapping>
    <level value="DEBUG" />
    <eventLogEntryType value="Information" />
</mapping>

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

Requirements

Namespace: log4net.Appender

Assembly: log4net (in log4net.dll)

See Also

EventLogAppender Members | log4net.Appender Namespace