NetSendAppender Class | Apache log4net™ SDK Documentation

Logs entries by sending network messages using the NetMessageBufferSend(String, String, String, String, Int32) native function.
Inheritance Hierarchy

System
Object
log4net.Appender
AppenderSkeleton
log4net.Appender
NetSendAppender

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

C#
VB
C++
F#
Copy

    public class NetSendAppender : AppenderSkeleton

    Public Class NetSendAppender
    	Inherits AppenderSkeleton

    public ref class NetSendAppender : public AppenderSkeleton

    type NetSendAppender =
        class
            inherit AppenderSkeleton
        end

The NetSendAppender type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| NetSendAppender | Initializes the appender.

Top
Properties

| Name | Description
--- | --- | ---
| ErrorHandler | Gets or sets the IErrorHandler for this appender. (Inherited from AppenderSkeleton.)
| FilterHead | The filter chain. (Inherited from AppenderSkeleton.)
| Layout | Gets or sets the ILayout for this appender. (Inherited from AppenderSkeleton.)
| Name | Gets or sets the name of this appender. (Inherited from AppenderSkeleton.)
| Recipient | Gets or sets the message alias to which the message should be sent.
| RequiresLayout | This appender requires a log4net.Layout to be set. (Overrides AppenderSkeleton RequiresLayout.)
| SecurityContext | Gets or sets the SecurityContext used to call the NetSend method.
| Sender | Gets or sets the sender of the message.
| Server | Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute.
| Threshold | Gets or sets the threshold Level of this appender. (Inherited from AppenderSkeleton.)

Top
Methods

| Name | Description
--- | --- | ---
| ActivateOptions | Initialize the appender based on the options set. (Overrides AppenderSkeleton ActivateOptions .)
| AddFilter | Adds a filter to the end of the filter chain. (Inherited from AppenderSkeleton.)
| Append( LoggingEvent ) | Append a bulk array of logging events. (Inherited from AppenderSkeleton.)
| Append(LoggingEvent) | This method is called by the DoAppend(LoggingEvent) method. (Overrides AppenderSkeleton 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.)
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
| GetType | Gets the Type of the current instance. (Inherited from Object.)
| 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.)
| NetMessageBufferSend | Sends a buffer of information to a registered message alias.
| OnClose | Is called when the appender is closed. Derived classes should override this method if resources need to be released. (Inherited from AppenderSkeleton.)
| 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

You can send messages only to names that are active on the network. If you send the message to a user name, that user must be logged on and running the Messenger service to receive the message.

The receiver will get a top most window displaying the messages one at a time, therefore this appender should not be used to deliver a high volume of messages.

The following table lists some possible uses for this appender :

Action | Property Value(s)
--- | ---
Send a message to a user account on the local machine | Server = <name of the local machine> Recipient = <user name>
Send a message to a user account on a remote machine | Server = <name of the remote machine> Recipient = <user name>
Send a message to a domain user account | Server = <name of a domain controller | uninitialized> Recipient = <user name>
Send a message to all the names in a workgroup or domain | Recipient = <workgroup name | domain name>*
Send a message from the local machine to a remote machine | Server = <name of the local machine | uninitialized> Recipient = <name of the remote machine>

Note : security restrictions apply for sending network messages, see NetMessageBufferSend(String, String, String, String, Int32) for more information.

Examples

An example configuration section to log information using this appender from the local machine, named LOCAL_PC, to machine OPERATOR_PC :

Copy

    <appender name="NetSendAppender_Operator" type="log4net.Appender.NetSendAppender"><server value="LOCAL_PC" /><recipient value="OPERATOR_PC" /><layout type="log4net.Layout.PatternLayout" value="%-5p %c [%x] - %m%n" /></appender>

See Also

#### Reference

log4net.Appender Namespace