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

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.

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.

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.

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.