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
loggerILoggerThe logger.
eventCountintNumber of events that were considered.
eventTypeNamesDistinctEventTypeNamesDeferred-formatting wrapper that renders distinct event type names from the considered batch.
projectionNamestringThe 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
loggerILoggerThe logger.
exceptionExceptionThe failure.
projectionNamestringThe 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
loggerILoggerThe logger.
exceptionExceptionThe handler's report.
streamIdGuidThe stream the fact belongs to.
eventTypeNamestringThe type name of the fact that could not be applied yet.
attemptintThe 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
loggerILoggerThe logger.
exceptionExceptionThe failure.
afterSequencelongThe sequence number the batch starts after.
attemptintThe 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
loggerILoggerThe logger.
countintThe number of events in the batch.
lastSequencelongThe 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
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
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
loggerILoggerThe 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
loggerILoggerThe 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
loggerILoggerThe 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
loggerILoggerThe logger.