RemoteSyslogAppender Class | Apache log4net™ SDK Documentation

Logs events to a remote syslog daemon.
Inheritance Hierarchy

System
Object
log4net.Appender
AppenderSkeleton
log4net.Appender
UdpAppender
log4net.Appender
RemoteSyslogAppender

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

C#
VB
C++
F#
Copy

    public class RemoteSyslogAppender : UdpAppender

    Public Class RemoteSyslogAppender
    	Inherits UdpAppender

    public ref class RemoteSyslogAppender : public UdpAppender

    type RemoteSyslogAppender =
        class
            inherit UdpAppender
        end

The RemoteSyslogAppender type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| RemoteSyslogAppender | Initializes a new instance of the RemoteSyslogAppender class.

Top
Properties

| Name | Description
--- | --- | ---
| Client | Gets or sets the underlying UdpClient. (Inherited from UdpAppender.)
| Encoding | Gets or sets Encoding used to write the packets. (Inherited from UdpAppender.)
| ErrorHandler | Gets or sets the IErrorHandler for this appender. (Inherited from AppenderSkeleton.)
| Facility | Syslog facility
| FilterHead | The filter chain. (Inherited from AppenderSkeleton.)
| Identity | Message identity
| Layout | Gets or sets the ILayout for this appender. (Inherited from AppenderSkeleton.)
| LocalPort | Gets or sets the TCP port number from which the underlying UdpClient will communicate. (Inherited from UdpAppender.)
| Name | Gets or sets the name of this appender. (Inherited from AppenderSkeleton.)
| RemoteAddress | 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.)
| RemoteEndPoint | Gets or sets the cached remote endpoint to which the logging events should be sent. (Inherited from UdpAppender.)
| RemotePort | 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.)
| RequiresLayout | This appender requires a log4net.Layout to be set. (Inherited from UdpAppender.)
| Threshold | Gets or sets the threshold Level of this appender. (Inherited from AppenderSkeleton.)

Top
Methods

| Name | Description
--- | --- | ---
| ActivateOptions | Initialize the options for this appender (Overrides UdpAppender ActivateOptions .)
| AddFilter | Adds a filter to the end of the filter chain. (Inherited from AppenderSkeleton.)
| AddMapping | Add a mapping of level to severity
| Append( LoggingEvent ) | Append a bulk array of logging events. (Inherited from AppenderSkeleton.)
| Append(LoggingEvent) | This method is called by the DoAppend(LoggingEvent) method. (Overrides UdpAppender Append(LoggingEvent).)
| ClearFilters | Clears the filter list for this appender. (Inherited from AppenderSkeleton.)
| Close | Closes the appender and release resources. (Inherited from AppenderSkeleton.)
| DoAppend(LoggingEvent) | Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific [M:Append(LoggingEvent)] method. (Inherited from AppenderSkeleton.)
| DoAppend( LoggingEvent ) | Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific [M:Append(LoggingEvent[])] method. (Inherited from AppenderSkeleton.)
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
| FilterEvent | Test if the logging event should we output by this appender (Inherited from AppenderSkeleton.)
| Finalize | Finalizes this appender by calling the implementation's Close method. (Inherited from AppenderSkeleton.)
| Flush | Flushes any buffered log data. (Inherited from AppenderSkeleton.)
| GeneratePriority | Generate a syslog priority.
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
| GetSeverity | Translates a log4net level to a syslog severity.
| GetType | Gets the Type of the current instance. (Inherited from Object.)
| InitializeClientConnection | Initializes the underlying UdpClient connection. (Inherited from UdpAppender.)
| IsAsSevereAsThreshold | Checks if the message level is below this appender's threshold. (Inherited from AppenderSkeleton.)
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.)
| OnClose | Closes the UDP connection and releases all resources associated with this UdpAppender instance. (Inherited from UdpAppender.)
| PreAppendCheck | Called before [M:Append(LoggingEvent)] as a precondition. (Inherited from AppenderSkeleton.)
| RenderLoggingEvent(LoggingEvent) | Renders the LoggingEvent to a string. (Inherited from AppenderSkeleton.)
| RenderLoggingEvent(TextWriter, LoggingEvent) | Renders the LoggingEvent to a string. (Inherited from AppenderSkeleton.)
| ToString | 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 RemoteSyslogAppender
SyslogFacility 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

log4net.Appender Namespace