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
categoriesMessageCategoryThe categories (flags) that are forwarded.
sinkILogEventSinkThe 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
logEventLogEventThe event to filter.