RemoteSyslogAppender ClassApache log4net™ SDK Documentation
Logs events to a remote syslog daemon.
Inheritance Hierarchy

SystemObject
  log4net.AppenderAppenderSkeleton
    log4net.AppenderUdpAppender
      log4net.AppenderRemoteSyslogAppender

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

public class RemoteSyslogAppender : UdpAppender

The RemoteSyslogAppender type exposes the following members.

Constructors

  NameDescription
Public methodRemoteSyslogAppender
Initializes a new instance of the RemoteSyslogAppender class.
Top
Properties

  NameDescription
Protected propertyClient
Gets or sets the underlying UdpClient.
(Inherited from UdpAppender.)
Public propertyEncoding
Gets or sets Encoding used to write the packets.
(Inherited from UdpAppender.)
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 propertyLocalPort
Gets or sets the TCP port number from which the underlying UdpClient will communicate.
(Inherited from UdpAppender.)
Public propertyName
Gets or sets the name of this appender.
(Inherited from AppenderSkeleton.)
Public propertyRemoteAddress
Gets or sets the IP address of the remote host or multicast group to which the underlying UdpClient should sent the logging event.
(Inherited from UdpAppender.)
Protected propertyRemoteEndPoint
Gets or sets the cached remote endpoint to which the logging events should be sent.
(Inherited from UdpAppender.)
Public propertyRemotePort
Gets or sets the TCP port number of the remote host or multicast group to which the underlying UdpClient should sent the logging event.
(Inherited from UdpAppender.)
Protected propertyRequiresLayout
This appender requires a log4net.Layout to be set.
(Inherited from UdpAppender.)
Public propertyThreshold
Gets or sets the threshold Level of this appender.
(Inherited from AppenderSkeleton.)
Top
Methods

  NameDescription
Public methodActivateOptions
Initialize the options for this appender
(Overrides UdpAppenderActivateOptions.)
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 UdpAppenderAppend(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 methodStatic memberGeneratePriority
Generate a syslog priority.
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 methodInitializeClientConnection
Initializes the underlying UdpClient connection.
(Inherited from UdpAppender.)
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
Closes the UDP connection and releases all resources associated with this UdpAppender instance.
(Inherited from UdpAppender.)
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

The BSD syslog protocol is used to remotely log to a syslog daemon. The syslogd listens for for messages on UDP port 514.

The syslog UDP protocol is not authenticated. Most syslog daemons do not accept remote log messages because of the security implications. You may be able to use the LocalSyslogAppender to talk to a local syslog service.

There is an RFC 3164 that claims to document the BSD Syslog Protocol. This RFC can be seen here: http://www.faqs.org/rfcs/rfc3164.html. This appender generates what the RFC calls an "Original Device Message", i.e. does not include the TIMESTAMP or HOSTNAME fields. By observation this format of message will be accepted by all current syslog daemon implementations. The daemon will attach the current time and the source hostname or IP address to any messages received.

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 RemoteSyslogAppenderSyslogFacility 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 Domain).

See Also

Reference