Table of Contents

Class DefaultEventSink

Namespace
Fdyay.IdentityServer.Events
Assembly
Fdyay.IdentityServer.Core.dll

Writes events to the logger, so events are observable before a host writes a sink.

public class DefaultEventSink : IEventSink
Inheritance
DefaultEventSink
Implements
Inherited Members

Remarks

The default has to be something rather than nothing: a host that switches events on and sees no output cannot tell a working pipeline with an empty sink from a broken one. Logging is the one destination every host already has.

Level follows the event type, so an Error is not filtered out by a logger configured for warnings and above. A Failure is a refused request rather than a fault, so it is information, not a warning — a server refusing bad requests is a server working.

Constructors

DefaultEventSink(ILogger<DefaultEventSink>)

A sink that writes to logger.

public DefaultEventSink(ILogger<DefaultEventSink> logger)

Parameters

logger ILogger<DefaultEventSink>

The logger events are written to.

Methods

PersistAsync(Event, CancellationToken)

Takes a raised event to wherever this sink sends events.

public Task PersistAsync(Event evt, CancellationToken cancellationToken = default)

Parameters

evt Event

The event, already stamped with its time, process and request fields.

cancellationToken CancellationToken

Cancels the write.

Returns

Task

A task that completes when the event has been handed on.