Table of Contents

Class LoggerMiddleware

Namespace
IceRpc.Logger
Assembly
IceRpc.Logger.dll

A middleware that writes a log entry to an ILogger for each dispatch.

public class LoggerMiddleware : IDispatcher
Inheritance
LoggerMiddleware
Implements
Inherited Members

Constructors

LoggerMiddleware(IDispatcher, ILogger)

Constructs a logger middleware.

public LoggerMiddleware(IDispatcher next, ILogger logger)

Parameters

next IDispatcher

The next dispatcher in the dispatch pipeline.

logger ILogger

The logger to log to.

Methods

DispatchAsync(IncomingRequest, CancellationToken)

Dispatches an incoming request and returns the corresponding outgoing response.

public ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, CancellationToken cancellationToken)

Parameters

request IncomingRequest

The incoming request being dispatched.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask<OutgoingResponse>

The corresponding OutgoingResponse.

See Also