Search Results for

    Show / Hide Table of Contents

    Class ThrottleTargetWrapper

    An optional wrapper target that aggregates similar consecutive log messages, which can be useful when enabling Debug or Trace logging with high volume data. The aggregation only applies to messages that have the same: Log level, Locator, Category, ThreadId (if present), and Message.

    To use this, add a wrapper target of type "ThrottleTargetWrapper" to the NLog configuration.

    Inheritance
    Object
    NLog.Targets.Target
    NLog.Targets.Wrappers.WrapperTargetBase
    ThrottleTargetWrapper
    Implements
    IDisposable
    Inherited Members
    NLog.Targets.Wrappers.WrapperTargetBase.ToString()
    NLog.Targets.Wrappers.WrapperTargetBase.Write(NLog.LogEventInfo)
    NLog.Targets.Wrappers.WrapperTargetBase.WrappedTarget
    NLog.Targets.Target.Dispose()
    NLog.Targets.Target.Flush(NLog.Common.AsyncContinuation)
    NLog.Targets.Target.PrecalculateVolatileLayouts(NLog.LogEventInfo)
    NLog.Targets.Target.WriteAsyncLogEvent(NLog.Common.AsyncLogEventInfo)
    NLog.Targets.Target.WriteAsyncLogEvents(NLog.Common.AsyncLogEventInfo[])
    NLog.Targets.Target.WriteAsyncLogEvents(System.Collections.Generic.IList<NLog.Common.AsyncLogEventInfo>)
    NLog.Targets.Target.Dispose(System.Boolean)
    NLog.Targets.Target.WriteAsyncThreadSafe(NLog.Common.AsyncLogEventInfo)
    NLog.Targets.Target.Write(NLog.Common.AsyncLogEventInfo[])
    NLog.Targets.Target.Write(System.Collections.Generic.IList<NLog.Common.AsyncLogEventInfo>)
    NLog.Targets.Target.WriteAsyncThreadSafe(NLog.Common.AsyncLogEventInfo[])
    NLog.Targets.Target.WriteAsyncThreadSafe(System.Collections.Generic.IList<NLog.Common.AsyncLogEventInfo>)
    NLog.Targets.Target.MergeEventProperties(NLog.LogEventInfo)
    NLog.Targets.Target.RenderLogEvent(NLog.Layouts.Layout, NLog.LogEventInfo)
    NLog.Targets.Target.Register<T>(System.String)
    NLog.Targets.Target.Register(System.String, System.Type)
    NLog.Targets.Target.Name
    NLog.Targets.Target.OptimizeBufferReuse
    NLog.Targets.Target.SyncRoot
    NLog.Targets.Target.LoggingConfiguration
    NLog.Targets.Target.IsInitialized
    Namespace: actionETL.Logging.NLogExternal
    Assembly: actionETL.dll
    Syntax
    [Target("ThrottleTargetWrapper", IsWrapper = true)]
    public class ThrottleTargetWrapper : WrapperTargetBase, IDisposable

    Constructors

    ThrottleTargetWrapper()

    Initializes a new instance of the ThrottleTargetWrapper class.

    Not used directly by the library user.

    Declaration
    public ThrottleTargetWrapper()

    ThrottleTargetWrapper(Target)

    Initializes a new instance of the ThrottleTargetWrapper class.

    Not used directly by the library user.

    Declaration
    public ThrottleTargetWrapper(Target target)
    Parameters
    Type Name Description
    NLog.Targets.Target target

    The target.

    Properties

    MaxThrottled

    Gets or sets the maximum throttled messages before outputting them.

    Not used directly by the library user.

    Declaration
    public int MaxThrottled { get; set; }
    Property Value
    Type Description
    Int32

    Maximum number of aggregated messages before outputting them.

    MinDuplicates

    Gets or sets the minimum duplicates before throttling occurs.

    Not used directly by the library user.

    Declaration
    public int MinDuplicates { get; set; }
    Property Value
    Type Description
    Int32

    The minimum duplicates.

    TimeoutSeconds

    Gets or sets the maximum time before outputting currently aggregated messages.

    Not used directly by the library user.

    Declaration
    public double TimeoutSeconds { get; set; }
    Property Value
    Type Description
    Double

    The timeout seconds.

    Methods

    CloseTarget()

    Closes the target and releases any unmanaged resources.

    Not used directly by the library user.

    Declaration
    protected override void CloseTarget()
    Overrides
    NLog.Targets.Target.CloseTarget()
    Exceptions
    Type Condition
    InvalidOperationException

    Unexpected log events in CloseTarget().

    FlushAsync(AsyncContinuation)

    Flushes pending events (if any).

    Not used directly by the library user.

    Declaration
    protected override void FlushAsync(AsyncContinuation asyncContinuation)
    Parameters
    Type Name Description
    NLog.Common.AsyncContinuation asyncContinuation

    The asynchronous continuation.

    Overrides
    NLog.Targets.Wrappers.WrapperTargetBase.FlushAsync(NLog.Common.AsyncContinuation)

    InitializeTarget()

    Initializes the target. Can be used by inheriting classes to initialize logging.

    Not used directly by the library user.

    Declaration
    protected override void InitializeTarget()
    Overrides
    NLog.Targets.Target.InitializeTarget()

    Write(AsyncLogEventInfo)

    Writes the specified asynchronous log event information.

    Not used directly by the library user.

    Declaration
    protected override void Write(AsyncLogEventInfo logEvent)
    Parameters
    Type Name Description
    NLog.Common.AsyncLogEventInfo logEvent

    The asynchronous log event information.

    Overrides
    NLog.Targets.Target.Write(NLog.Common.AsyncLogEventInfo)

    Implements

    System.IDisposable
    In This Article
    Back to top Copyright © 2023 Envobi Ltd