LocalSyslogAppender ClassApache log4net™ SDK Documentation
Logs events to a local syslog service.
Inheritance Hierarchy

SystemObject
  log4net.AppenderAppenderSkeleton
    log4net.AppenderLocalSyslogAppender

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.6.0-.NET 4.0
Syntax

public class LocalSyslogAppender : AppenderSkeleton

The LocalSyslogAppender type exposes the following members.

Constructors

  NameDescription
Public methodLocalSyslogAppender
Initializes a new instance of the LocalSyslogAppender class.
Top
Properties

  NameDescription
Public propertyErrorHandler
Gets or sets the IErrorHandler for this appender.
(Inherited from AppenderSkeleton.)
Public propertyFacility
Syslog facility
Public propertyFilterHead
The filter chain.
(Inherited from AppenderSkeleton.)
Public propertyIdentity
Message identity
Public propertyLayout
Gets or sets the ILayout for this appender.
(Inherited from AppenderSkeleton.)
Public propertyName
Gets or sets the name of this appender.
(Inherited from AppenderSkeleton.)
Protected propertyRequiresLayout
This appender requires a Layout to be set.
(Overrides AppenderSkeletonRequiresLayout.)
Public propertyThreshold
Gets or sets the threshold Level of this appender.
(Inherited from AppenderSkeleton.)
Top
Methods

  NameDescription
Public methodActivateOptions
Initialize the appender based on the options set.
(Overrides AppenderSkeletonActivateOptions.)
Public methodAddFilter
Adds a filter to the end of the filter chain.
(Inherited from AppenderSkeleton.)
Public methodAddMapping
Add a mapping of level to severity
Protected methodAppend(LoggingEvent)
Append a bulk array of logging events.
(Inherited from AppenderSkeleton.)
Protected methodAppend(LoggingEvent)
This method is called by the DoAppend(LoggingEvent) method.
(Overrides AppenderSkeletonAppend(LoggingEvent).)
Public methodClearFilters
Clears the filter list for this appender.
(Inherited from AppenderSkeleton.)
Public methodClose
Closes the appender and release resources.
(Inherited from AppenderSkeleton.)
Public methodDoAppend(LoggingEvent)
Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific [M:Append(LoggingEvent)] method.
(Inherited from AppenderSkeleton.)
Public methodDoAppend(LoggingEvent)
Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific [M:Append(LoggingEvent[])] method.
(Inherited from AppenderSkeleton.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFilterEvent
Test if the logging event should we output by this appender
(Inherited from AppenderSkeleton.)
Protected methodFinalize
Finalizes this appender by calling the implementation's Close method.
(Inherited from AppenderSkeleton.)
Public methodFlush
Flushes any buffered log data.
(Inherited from AppenderSkeleton.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Protected methodGetSeverity
Translates a log4net level to a syslog severity.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodIsAsSevereAsThreshold
Checks if the message level is below this appender's threshold.
(Inherited from AppenderSkeleton.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnClose
Close the syslog when the appender is closed
(Overrides AppenderSkeletonOnClose.)
Protected methodPreAppendCheck
Called before [M:Append(LoggingEvent)] as a precondition.
(Inherited from AppenderSkeleton.)
Protected methodRenderLoggingEvent(LoggingEvent)
Renders the LoggingEvent to a string.
(Inherited from AppenderSkeleton.)
Protected methodRenderLoggingEvent(TextWriter, LoggingEvent)
Renders the LoggingEvent to a string.
(Inherited from AppenderSkeleton.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Remarks

Note Note
This appender uses the POSIX libc library functions openlog, syslog, and closelog. If these functions are not available on the local system then this appender will not work!

The functions openlog, syslog, and closelog are specified in SUSv2 and POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service.

This appender talks to a local syslog service. If you need to log to a remote syslog daemon and you cannot configure your local syslog service to do this you may be able to use the RemoteSyslogAppender to log via UDP.

Syslog messages must have a facility and and a severity. The severity is derived from the Level of the logging event. The facility must be chosen from the set of defined syslog LocalSyslogAppenderSyslogFacility values. The facilities list is predefined and cannot be extended.

An identifier is specified with each log message. This can be specified by setting the Identity property. The identity (also know as the tag) must not contain white space. The default value for the identity is the application name (from ApplicationFriendlyName).

See Also

Reference