Skip to main content
Table of Contents

Class LoggerCommandExtensions

Namespace
Stratara.Shared.Diagnostics.Extensions
Assembly
Stratara.Shared.dll

Source-generated structured-logging helpers for the command-handling worker lifecycle. Backed by LoggerMessageAttribute with stable event ids from LogEvents.CommandProcessing.

public static class LoggerCommandExtensions
Inheritance
LoggerCommandExtensions
Inherited Members

Methods

LogCommandEnvelopeIntegrityRejected(ILogger, Guid)

Logs that a command envelope was rejected under Strict mode because its signature did not verify.

[LoggerMessage(EventId = 105104, Level = LogLevel.Error, Message = "Command envelope {EnvelopeId} carries a signature that does not verify (Strict mode) — rejecting envelope.")]
public static void LogCommandEnvelopeIntegrityRejected(this ILogger logger, Guid envelopeId)

Parameters

logger ILogger

The logger to emit through.

envelopeId Guid

The id of the rejected envelope.

LogCommandEnvelopeIntegrityWarning(ILogger, Guid)

Logs that a command envelope carried a signature that did not verify, and is still being dispatched under Permissive mode.

[LoggerMessage(EventId = 105003, Level = LogLevel.Warning, Message = "Command envelope {EnvelopeId} carries a signature that does not verify (Permissive mode) — dispatching anyway. The publisher holds a different key, or the envelope was altered in transit.")]
public static void LogCommandEnvelopeIntegrityWarning(this ILogger logger, Guid envelopeId)

Parameters

logger ILogger

The logger to emit through.

envelopeId Guid

The id of the offending envelope.

LogCommandEnvelopeUnsignedRejected(ILogger, Guid)

Logs that a command envelope was rejected under Strict mode because it carried no signature.

[LoggerMessage(EventId = 105105, Level = LogLevel.Error, Message = "Command envelope {EnvelopeId} carries no signature (Strict mode) — rejecting envelope. A publisher is not signing.")]
public static void LogCommandEnvelopeUnsignedRejected(this ILogger logger, Guid envelopeId)

Parameters

logger ILogger

The logger to emit through.

envelopeId Guid

The id of the rejected envelope.

LogCommandEnvelopeUnsignedWarning(ILogger, Guid)

Logs that a command envelope carried no signature, and is still being dispatched under Permissive mode.

[LoggerMessage(EventId = 105004, Level = LogLevel.Warning, Message = "Command envelope {EnvelopeId} carries no signature (Permissive mode) — dispatching anyway. Expected while publishers are still being rolled over to signing; afterwards it means a publisher was missed.")]
public static void LogCommandEnvelopeUnsignedWarning(this ILogger logger, Guid envelopeId)

Parameters

logger ILogger

The logger to emit through.

envelopeId Guid

The id of the unsigned envelope.

LogCommandWorkerLaneStarted(ILogger, string, string, int)

Logs that a command-worker lane has bound to its topic and subscription.

[LoggerMessage(EventId = 105005, Level = LogLevel.Information, Message = "Command-Worker lane bound to subscription {Subscription} on topic {Topic} with degree-of-parallelism {DegreeOfParallelism}.")]
public static void LogCommandWorkerLaneStarted(this ILogger logger, string subscription, string topic, int degreeOfParallelism)

Parameters

logger ILogger

The logger to emit through.

subscription string

The subscription the lane consumes (interactive or heavy).

topic string

The command topic the lane consumes.

degreeOfParallelism int

The number of concurrent subscriptions the lane opens.

LogCommandWorkerStarted(ILogger)

Logs that the command-handling worker has started.

[LoggerMessage(EventId = 105001, Level = LogLevel.Information, Message = "Starting Command-Worker.")]
public static void LogCommandWorkerStarted(this ILogger logger)

Parameters

logger ILogger

The logger to emit through.

LogCommandWorkerStopped(ILogger)

Logs that the command-handling worker is shutting down.

[LoggerMessage(EventId = 105002, Level = LogLevel.Information, Message = "Stopping Command-Worker.")]
public static void LogCommandWorkerStopped(this ILogger logger)

Parameters

logger ILogger

The logger to emit through.