Class LoggerChangeSetExtensions
- Namespace
- Stratara.Shared.Diagnostics.Extensions
- Assembly
- Stratara.Projections.dll
Source-generated logger extensions for the projection change-set merge pipeline.
public static class LoggerChangeSetExtensions
- Inheritance
-
LoggerChangeSetExtensions
- Inherited Members
Methods
LogChangeSetApplied(ILogger, Guid)
Logs that a change-set has been applied to an aggregate.
[LoggerMessage(EventId = 100003, Level = LogLevel.Debug, Message = "Change set applied to aggregate {AggregateId}.")]
public static void LogChangeSetApplied(this ILogger logger, Guid aggregateId)
Parameters
LogChangeSetCreated(ILogger, Guid, IReadOnlyList<ChangeDetail>)
Convenience overload that turns an IReadOnlyList<T> into the safe (names-only) form before forwarding to the source-generated logger method.
public static void LogChangeSetCreated(this ILogger logger, Guid aggregateId, IReadOnlyList<ChangeDetail> changeSet)
Parameters
loggerILoggerThe logger.
aggregateIdGuidThe aggregate identifier.
changeSetIReadOnlyList<ChangeDetail>The list of detected field changes — only the names are logged.
LogChangeSetCreated(ILogger, Guid, int, ChangeSetFieldNames)
Logs that a change-set has been computed for an aggregate, listing the changed field
names but never their values — values may carry [EncryptData]-protected PII that
must not leak into the log pipeline (Round-3-Audit Finding R3-Sec-005).
[LoggerMessage(EventId = 100002, Level = LogLevel.Debug, Message = "Change set created for aggregate {AggregateId}: {ChangeCount} field(s) changed ({FieldNames}).")]
public static void LogChangeSetCreated(this ILogger logger, Guid aggregateId, int changeCount, ChangeSetFieldNames fieldNames)
Parameters
loggerILoggerThe logger.
aggregateIdGuidThe aggregate identifier.
changeCountintNumber of fields changed.
fieldNamesChangeSetFieldNamesDeferred-formatting wrapper that renders the changed property names only.
LogChangeSetNotFound(ILogger, string, Guid)
Logs that the aggregate referenced by a change-set could not be found in the event store.
[LoggerMessage(EventId = 100101, Level = LogLevel.Error, Message = "Failed to create change set for {AggregateType} with ID {AggregateId}: Aggregate not found in event store.")]
public static void LogChangeSetNotFound(this ILogger logger, string aggregateType, Guid aggregateId)
Parameters
loggerILoggerThe logger.
aggregateTypestringThe aggregate type name.
aggregateIdGuidThe aggregate identifier that was not found.
LogNoChangesToApplied(ILogger, Guid)
Logs that the computed change-set was empty and no events were emitted.
[LoggerMessage(EventId = 100004, Level = LogLevel.Debug, Message = "No changes to apply for aggregate {AggregateId}.")]
public static void LogNoChangesToApplied(this ILogger logger, Guid aggregateId)