Table of Contents

Class CategoryFilterSink

Namespace
Arc4u.Diagnostics.Sinks
Assembly
Arc4u.Diagnostics.Serilog.dll

A sink that forwards to another sink only the events whose Arc4u MessageCategory is one of the configured categories.

public class CategoryFilterSink : ILogEventSink, IDisposable
Inheritance
CategoryFilterSink
Implements
ILogEventSink
Inherited Members

Constructors

CategoryFilterSink(MessageCategory, ILogEventSink)

Initializes a new instance of the CategoryFilterSink class.

public CategoryFilterSink(MessageCategory categories, ILogEventSink sink)

Parameters

categories MessageCategory

The categories (flags) that are forwarded.

sink ILogEventSink

The sink that receives the matching events.

Properties

Sink

Gets or sets the sink that receives the matching events.

public ILogEventSink Sink { get; set; }

Property Value

ILogEventSink

Methods

Dispose()

Disposes the wrapped sink when it is disposable.

public void Dispose()

Emit(LogEvent)

Check if the message contains a category property! If no, the message is skipped. If yes, only messages with the registered categories are sent.

public void Emit(LogEvent logEvent)

Parameters

logEvent LogEvent

The event to filter.