EventLogAppender ClassApache log4net™ SDK Documentation
Writes events to the system event log.
Inheritance Hierarchy

OnlineSystem Object
  log4net.Appender AppenderSkeleton
    log4net.Appender EventLogAppender

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 1.2.15.0 (1.2.15.0)
Syntax

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

<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 OnlineEventLogEntryType enum, i.e.:

  • Error
    an error event
  • Warning
    a warning event
  • Information
    an informational event

See Also