C# Class NLog.Targets.Wrappers.LimitingTargetWrapper

Inheritance: NLog.Targets.Wrappers.WrapperTargetBase
Afficher le fichier Open project: NLog/NLog Class Usage Examples

Private Properties

Свойство Type Description
IsIntervalExpired bool
ResetInterval void

Méthodes publiques

Méthode Description
LimitingTargetWrapper ( ) : System

Initializes a new instance of the LimitingTargetWrapper class.

LimitingTargetWrapper ( Target wrappedTarget ) : System

Initializes a new instance of the LimitingTargetWrapper class.

LimitingTargetWrapper ( Target wrappedTarget, int messageLimit, System.TimeSpan interval ) : System

Initializes a new instance of the LimitingTargetWrapper class.

LimitingTargetWrapper ( string name, Target wrappedTarget ) : System

Initializes a new instance of the LimitingTargetWrapper class.

Méthodes protégées

Méthode Description
InitializeTarget ( ) : void

Initializes the target and resets the current Interval and MessagesWrittenCount.

Write ( NLog.Common.AsyncLogEventInfo logEvent ) : void

Writes log event to the wrapped target if the current MessagesWrittenCount is lower than MessageLimit. If the MessageLimit is already reached, no log event will be written to the wrapped target. MessagesWrittenCount resets when the current Interval is expired.

Private Methods

Méthode Description
IsIntervalExpired ( ) : bool
ResetInterval ( ) : void

Method Details

InitializeTarget() protected méthode

Initializes the target and resets the current Interval and MessagesWrittenCount.
protected InitializeTarget ( ) : void
Résultat void

LimitingTargetWrapper() public méthode

Initializes a new instance of the LimitingTargetWrapper class.
public LimitingTargetWrapper ( ) : System
Résultat System

LimitingTargetWrapper() public méthode

Initializes a new instance of the LimitingTargetWrapper class.
public LimitingTargetWrapper ( Target wrappedTarget ) : System
wrappedTarget Target The wrapped target.
Résultat System

LimitingTargetWrapper() public méthode

Initializes a new instance of the LimitingTargetWrapper class.
public LimitingTargetWrapper ( Target wrappedTarget, int messageLimit, System.TimeSpan interval ) : System
wrappedTarget Target The wrapped target.
messageLimit int Maximum number of messages written per interval.
interval System.TimeSpan Interval in which the maximum number of messages can be written.
Résultat System

LimitingTargetWrapper() public méthode

Initializes a new instance of the LimitingTargetWrapper class.
public LimitingTargetWrapper ( string name, Target wrappedTarget ) : System
name string The name of the target.
wrappedTarget Target The wrapped target.
Résultat System

Write() protected méthode

Writes log event to the wrapped target if the current MessagesWrittenCount is lower than MessageLimit. If the MessageLimit is already reached, no log event will be written to the wrapped target. MessagesWrittenCount resets when the current Interval is expired.
protected Write ( NLog.Common.AsyncLogEventInfo logEvent ) : void
logEvent NLog.Common.AsyncLogEventInfo Log event to be written out.
Résultat void