C# Class Esilog.Gelf4net.Appender.Gelf4NetAppender

The gelf 4 net appender.
Inheritance: log4net.Appender.AppenderSkeleton
显示文件 Open project: visit/gelf4net Class Usage Examples

Public Properties

Property Type Description
UNKNOWN_HOST string

Public Methods

Method Description
ActivateOptions ( ) : void

The activate options.

Gelf4NetAppender ( ) : System

Initializes a new instance of the Gelf4NetAppender class.

Protected Methods

Method Description
Append ( log4net.Core.LoggingEvent loggingEvent ) : void

Append a log event on graylog.

GetAdditionalFields ( log4net.Core.LoggingEvent loggingEvent ) : string>.Dictionary

The additional fields. Concate the additional fields specified in log4net config (AdditionalFields) and the LoggingEvent.Properties

GetFullMessage ( log4net.Core.LoggingEvent loggingEvent ) : string

Get full message. If a Layout was defined, the full message will use that. Append the log exception and stacktrace if LogStackTraceFromMessage is true.

GetGelfMessage ( log4net.Core.LoggingEvent loggingEvent ) : GelfMessage

Get a GelfMessage with info about logging event.

GetShortMessage ( string fullMessage, log4net.Core.LoggingEvent loggingEvent ) : string

Short message. Truncate the message to 250 character.

Private Methods

Method Description
GetIpAddressFromHostName ( ) : string

Get ip address from host name.

GetLoggingHostName ( ) : string

Get logging host name.

GetSyslogSeverity ( log4net.Core.Level level ) : int

Get syslog severity.

SendGelfMessageToGrayLog ( string message ) : void

Send gelf message to graylog.

Method Details

ActivateOptions() public method

The activate options.
public ActivateOptions ( ) : void
return void

Append() protected method

Append a log event on graylog.
protected Append ( log4net.Core.LoggingEvent loggingEvent ) : void
loggingEvent log4net.Core.LoggingEvent The logging event.
return void

Gelf4NetAppender() public method

Initializes a new instance of the Gelf4NetAppender class.
public Gelf4NetAppender ( ) : System
return System

GetAdditionalFields() protected method

The additional fields. Concate the additional fields specified in log4net config (AdditionalFields) and the LoggingEvent.Properties
protected GetAdditionalFields ( log4net.Core.LoggingEvent loggingEvent ) : string>.Dictionary
loggingEvent log4net.Core.LoggingEvent The logging event.
return string>.Dictionary

GetFullMessage() protected method

Get full message. If a Layout was defined, the full message will use that. Append the log exception and stacktrace if LogStackTraceFromMessage is true.
protected GetFullMessage ( log4net.Core.LoggingEvent loggingEvent ) : string
loggingEvent log4net.Core.LoggingEvent logging event.
return string

GetGelfMessage() protected method

Get a GelfMessage with info about logging event.
protected GetGelfMessage ( log4net.Core.LoggingEvent loggingEvent ) : GelfMessage
loggingEvent log4net.Core.LoggingEvent Logging event
return GelfMessage

GetShortMessage() protected method

Short message. Truncate the message to 250 character.
protected GetShortMessage ( string fullMessage, log4net.Core.LoggingEvent loggingEvent ) : string
fullMessage string The full message.
loggingEvent log4net.Core.LoggingEvent logging event.
return string

Property Details

UNKNOWN_HOST public_oe static_oe property

The unknown host.
public static string UNKNOWN_HOST
return string