Skip to main content
Table of Contents

Class LoggerScopeExtensions

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

Pre-baked logging-scope helpers for the create/update aggregate flows. Use these so that every log entry inside the scope picks up the aggregate id automatically.

public static class LoggerScopeExtensions
Inheritance
LoggerScopeExtensions
Inherited Members

Methods

BeginCreateAggregateScope(ILogger, Guid)

Begin a logging scope tagged with AggregateId = aggregateId for the create-aggregate flow.

public static IDisposable? BeginCreateAggregateScope(this ILogger logger, Guid aggregateId)

Parameters

logger ILogger

The logger.

aggregateId Guid

The id of the aggregate being created.

Returns

IDisposable

A disposable that ends the scope, or null when no scope provider is configured.

BeginUpdateAggregateScope(ILogger, Guid)

Begin a logging scope tagged with AggregateId = aggregateId for the update-aggregate flow.

public static IDisposable? BeginUpdateAggregateScope(this ILogger logger, Guid aggregateId)

Parameters

logger ILogger

The logger.

aggregateId Guid

The id of the aggregate being updated.

Returns

IDisposable

A disposable that ends the scope, or null when no scope provider is configured.