Skip to main content
Table of Contents

Class LoggerProjectionExtensions

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

Source-generated logger extensions for the projection worker, manager, and replay pipeline.

public static class LoggerProjectionExtensions
Inheritance
LoggerProjectionExtensions
Inherited Members

Methods

LogAbandonedReadModelsRestored(ILogger)

Logs that a state preserved by a replay whose host stopped was restored.

[LoggerMessage(EventId = 104023, Level = LogLevel.Warning, Message = "A replay whose host stopped left preserved read models; they were restored to their state before that replay began.")]
public static void LogAbandonedReadModelsRestored(this ILogger logger)

Parameters

logger ILogger

The logger.

LogEventsNotRelevantForProjection(ILogger, int, DistinctEventTypeNames, string)

Logs that none of the supplied events were relevant for the given projection.

[LoggerMessage(EventId = 104004, Level = LogLevel.Debug, Message = "None of {EventCount} events ({EventTypeNames}) were relevant for {ProjectionName}.")]
public static void LogEventsNotRelevantForProjection(this ILogger logger, int eventCount, DistinctEventTypeNames eventTypeNames, string projectionName)

Parameters

logger ILogger

The logger.

eventCount int

Number of events that were considered.

eventTypeNames DistinctEventTypeNames

Deferred-formatting wrapper that renders distinct event type names from the considered batch.

projectionName string

The projection name.

LogPreservedReadModelsNotDiscarded(ILogger, Exception, Guid)

Logs that the state preserved for a replay that succeeded could not be dropped.

[LoggerMessage(EventId = 104025, Level = LogLevel.Warning, Message = "Projection replay {RequestId} succeeded, but the read models preserved before it could not be dropped. A host that starts later drops them where the coordination state still holds this outcome, and restores them otherwise — which undoes the replay.")]
public static void LogPreservedReadModelsNotDiscarded(this ILogger logger, Exception exception, Guid requestId)

Parameters

logger ILogger

The logger.

exception Exception

The failure.

requestId Guid

The identity of the request the replay ran.

LogProjectionFailed(ILogger, Exception, string)

Logs that processing a projection threw an exception.

[LoggerMessage(EventId = 104103, Level = LogLevel.Error, Message = "Error while processing projection {ProjectionName}.")]
public static void LogProjectionFailed(this ILogger logger, Exception exception, string projectionName)

Parameters

logger ILogger

The logger.

exception Exception

The failure.

projectionName string

The projection that failed.

LogProjectionForgottenTenantFactPassedOver(ILogger, string, Guid, string, Guid)

Logs that a projection declaring IForgetsDeletedTenants reported a missing prerequisite for a fact of a tenant it has seen deleted, and that the fact was passed over.

[LoggerMessage(EventId = 104014, Level = LogLevel.Information, Message = "Projection {Projection} passed over {EventTypeName} on stream {StreamId}: its tenant {TenantId} was deleted, and the projection forgot it.")]
public static void LogProjectionForgottenTenantFactPassedOver(this ILogger logger, string projection, Guid streamId, string eventTypeName, Guid tenantId)

Parameters

logger ILogger

The logger.

projection string

The projection's name.

streamId Guid

The stream the fact belongs to.

eventTypeName string

The fact's type name.

tenantId Guid

The deleted tenant that owns the fact.

LogProjectionPrecedingFactMissing(ILogger, Exception, Guid, string, int)

Logs that a bundle refers to an entity that has not been applied yet and will be retried.

[LoggerMessage(EventId = 104010, Level = LogLevel.Warning, Message = "Projection bundle refers to an entity not applied yet on stream {StreamId} ({EventTypeName}); attempt {Attempt}.")]
public static void LogProjectionPrecedingFactMissing(this ILogger logger, Exception exception, Guid streamId, string eventTypeName, int attempt)

Parameters

logger ILogger

The logger.

exception Exception

The handler's report.

streamId Guid

The stream the fact belongs to.

eventTypeName string

The type name of the fact that could not be applied yet.

attempt int

The attempt that failed, counting from one.

LogProjectionReplayBatchFailed(ILogger, Exception, long, int)

Logs that one projection-replay batch failed on an attempt. While the policy allows another attempt the batch is applied again from its start; after the last one the replay fails.

[LoggerMessage(EventId = 104011, Level = LogLevel.Warning, Message = "Projection replay: batch after sequence {AfterSequence} failed on attempt {Attempt}. It is applied again from its start if the policy allows another attempt; otherwise the replay fails.")]
public static void LogProjectionReplayBatchFailed(this ILogger logger, Exception exception, long afterSequence, int attempt)

Parameters

logger ILogger

The logger.

exception Exception

The failure.

afterSequence long

The sequence number the batch starts after.

attempt int

The attempt that failed, counted from one.

LogProjectionReplayBatchPublished(ILogger, int, long)

Logs that a batch of events has been published during projection replay.

[LoggerMessage(EventId = 104008, Level = LogLevel.Information, Message = "Projection replay: processed batch of {Count} events, last sequence {LastSequence}.")]
public static void LogProjectionReplayBatchPublished(this ILogger logger, int count, long lastSequence)

Parameters

logger ILogger

The logger.

count int

The number of events in the batch.

lastSequence long

The sequence number of the last event in the batch.

LogProjectionReplayCompleted(ILogger, long)

Logs that projection replay has completed.

[LoggerMessage(EventId = 104006, Level = LogLevel.Information, Message = "Projection replay completed: {TotalEvents} events replayed.")]
public static void LogProjectionReplayCompleted(this ILogger logger, long totalEvents)

Parameters

logger ILogger

The logger.

totalEvents long

The total number of events that were replayed.

LogProjectionReplayFailed(ILogger, Exception)

Logs that projection replay failed with an exception.

[LoggerMessage(EventId = 104109, Level = LogLevel.Error, Message = "Projection replay failed.")]
public static void LogProjectionReplayFailed(this ILogger logger, Exception exception)

Parameters

logger ILogger

The logger.

exception Exception

The failure.

LogProjectionReplayInterrupted(ILogger, Guid, long)

Logs that a projection replay ended because its host stopped. It is not a failure.

[LoggerMessage(EventId = 104020, Level = LogLevel.Information, Message = "Projection replay {RequestId} interrupted by the host stopping after {ReplayedEvents} events. The read models are partly rebuilt — unless a host that keeps them restores them when it starts; otherwise request the replay again.")]
public static void LogProjectionReplayInterrupted(this ILogger logger, Guid requestId, long replayedEvents)

Parameters

logger ILogger

The logger.

requestId Guid

The identity of the request the replay ran.

replayedEvents long

The number of events the replay had applied when it ended.

LogProjectionReplayOutcomeNotRecorded(ILogger, Exception, Guid)

Logs that the outcome of a replay could not be recorded in the coordination state.

[LoggerMessage(EventId = 104121, Level = LogLevel.Error, Message = "The outcome of projection replay {RequestId} could not be recorded. Its marking lapses with its lease; the previous outcome stays readable.")]
public static void LogProjectionReplayOutcomeNotRecorded(this ILogger logger, Exception exception, Guid requestId)

Parameters

logger ILogger

The logger.

exception Exception

The failure.

requestId Guid

The identity of the request the replay ran.

LogProjectionReplayRenewalFailed(ILogger, Exception)

Logs, once per preparation, that a replay could not renew its marking; it tries again every second.

[LoggerMessage(EventId = 104026, Level = LogLevel.Warning, Message = "Projection replay could not renew its marking while it prepares; it tries again every second. If the coordination store stays away longer than the lease, the marking lapses and publication resumes mid-rebuild.")]
public static void LogProjectionReplayRenewalFailed(this ILogger logger, Exception exception)

Parameters

logger ILogger

The logger.

exception Exception

The failure.

LogProjectionReplayRequestNotClaimed(ILogger, Exception, Guid)

Logs that a replay request could not be claimed because the coordination state failed.

[LoggerMessage(EventId = 104127, Level = LogLevel.Error, Message = "Projection replay request {RequestId} could not be claimed; no replay started here.")]
public static void LogProjectionReplayRequestNotClaimed(this ILogger logger, Exception exception, Guid requestId)

Parameters

logger ILogger

The logger.

exception Exception

The failure.

requestId Guid

The identity of the request.

LogProjectionReplayStarted(ILogger)

Logs that projection replay has started.

[LoggerMessage(EventId = 104005, Level = LogLevel.Information, Message = "Projection replay started.")]
public static void LogProjectionReplayStarted(this ILogger logger)

Parameters

logger ILogger

The logger.

LogProjectionViewsTruncated(ILogger)

Logs that all projection views have been truncated as part of a replay.

[LoggerMessage(EventId = 104007, Level = LogLevel.Information, Message = "All projection views truncated.")]
public static void LogProjectionViewsTruncated(this ILogger logger)

Parameters

logger ILogger

The logger.

LogProjectionWorkerStarted(ILogger)

Logs that the projection worker has started.

[LoggerMessage(EventId = 104001, Level = LogLevel.Information, Message = "Starting Projection-Worker.")]
public static void LogProjectionWorkerStarted(this ILogger logger)

Parameters

logger ILogger

The logger.

LogProjectionWorkerStopped(ILogger)

Logs that the projection worker is stopping.

[LoggerMessage(EventId = 104002, Level = LogLevel.Information, Message = "Stopping Projection-Worker.")]
public static void LogProjectionWorkerStopped(this ILogger logger)

Parameters

logger ILogger

The logger.

LogReadModelRestoreFailed(ILogger, Exception)

Logs that preserved read models could not be restored; the preserved state is kept.

[LoggerMessage(EventId = 104124, Level = LogLevel.Error, Message = "The preserved read models could not be restored. The preserved state is kept; the read models hold what the replay rebuilt.")]
public static void LogReadModelRestoreFailed(this ILogger logger, Exception exception)

Parameters

logger ILogger

The logger.

exception Exception

The failure.

LogReadModelsPreserved(ILogger, Guid)

Logs that the read models a replay is about to empty were preserved.

[LoggerMessage(EventId = 104021, Level = LogLevel.Information, Message = "Projection replay {RequestId}: the read models are preserved and are restored if the replay fails.")]
public static void LogReadModelsPreserved(this ILogger logger, Guid requestId)

Parameters

logger ILogger

The logger.

requestId Guid

The identity of the request the replay runs.

LogReadModelsRestored(ILogger, Guid)

Logs that a failed replay restored the read models to their state before it began.

[LoggerMessage(EventId = 104022, Level = LogLevel.Warning, Message = "Projection replay {RequestId} failed; the read models were restored to their state before it began.")]
public static void LogReadModelsRestored(this ILogger logger, Guid requestId)

Parameters

logger ILogger

The logger.

requestId Guid

The identity of the request the replay ran.