Table of Contents

Class LogListener

Namespace
Tripous.Logging
Assembly
Tripous.Logging.dll

A listener for LogEntry messages.

A listener registers itself automatically with Logger, upon construction.

This class provides retain policy related properties to inheritors.

public abstract class LogListener
Inheritance
LogListener
Derived
Inherited Members
Extension Methods

Constructors

LogListener()

Constructor

public LogListener()

LogListener(bool)

Constructor

protected LogListener(bool AutoRegister)

Parameters

AutoRegister bool

Properties

MaxSizeKiloBytes

Retain policy. How many KB to allow a single log file to grow. Defaults to 512 KB

public virtual int MaxSizeKiloBytes { get; set; }

Property Value

int

RetainDays

Retain policy. How many days to retain in the storage medium. Defaults to 7

public virtual int RetainDays { get; set; }

Property Value

int

RetainPolicyCounter

After how many writes to check whether it is time to apply the retain policy. Defaults to 100

public virtual int RetainPolicyCounter { get; set; }

Property Value

int

Methods

ProcessLog(LogEntry)

Called by the Logger to pass LogEntry to a log listener.

CAUTION: The Logger calls its Listeners asynchronously, that is from inside a thread. Thus Listeners should synchronize the ProcessLog() call. Controls need to check if InvokeRequired.

public abstract void ProcessLog(LogEntry Entry)

Parameters

Entry LogEntry

Register()

Registers this listener to Logger

public void Register()

Unregister()

Unregisters this listener to Logger

public void Unregister()