Table of Contents

Class Quilt4NetLoggingOptions

Namespace
Quilt4Net.Toolkit
Assembly
Quilt4Net.Toolkit.dll

Options for universal telemetry identity. Configurable via code or appsettings.json at "Quilt4Net:Logging". These values populate OpenTelemetry Resource attributes and are attached to traces, logs and metrics automatically.

public record Quilt4NetLoggingOptions : IEquatable<Quilt4NetLoggingOptions>
Inheritance
Quilt4NetLoggingOptions
Implements
Inherited Members

Properties

ApplicationName

Application name used to identify this application in telemetry. Maps to OpenTelemetry resource attribute service.name (surfaces as cloud_RoleName in Application Insights). Default is the entry assembly name.

public string ApplicationName { get; set; }

Property Value

string

EnrichExceptionData

When true (the default), a logged exception's Data entries are copied onto the exception telemetry so they surface under customDimensions in Application Insights. This makes an id attached to the exception — e.g. e.AddData("CorrelationId", guid) — queryable, for example:

AppExceptions | where tostring(customDimensions.CorrelationId) == "<guid>"

Enrichment is applied to both the OpenTelemetry pipeline (via a log processor) and the classic Application Insights SDK (via an ITelemetryInitializer on ExceptionTelemetry). Set to false to opt out.

public bool EnrichExceptionData { get; set; }

Property Value

bool

Environment

Environment name (e.g. Development, Staging, Production). Maps to OpenTelemetry resource attribute deployment.environment (surfaces under customDimensions in Application Insights). Default resolution: IHostEnvironment.EnvironmentName → DOTNET_ENVIRONMENT → ASPNETCORE_ENVIRONMENT → "Production".

public string Environment { get; set; }

Property Value

string

IncludeScopes

When true, values from ILogger scopes (e.g. logger.BeginScope(...)) are captured and copied onto each log record so they surface under customDimensions in Application Insights. This is what makes the CorrelationId that CorrelationIdMiddleware pushes as a scope actually queryable on every AppTrace / AppException raised during the request. Default is false (opt-in) because scope capture increases telemetry volume; enable it deliberately with AddQuilt4NetLogging(o => o.IncludeScopes = true).

public bool IncludeScopes { get; set; }

Property Value

bool

MonitorName

Identifier for the instrumentation source emitting the telemetry. Surfaces as customDimensions["quilt4net.monitor"] on every trace, exception and request, so KQL queries can scope to telemetry produced by Quilt4Net (or by a per-deployment override) without parsing message text. Default is "Quilt4Net".

public string MonitorName { get; set; }

Property Value

string

ServiceInstanceId

Logical instance identifier used to disambiguate multiple deployments of the same compiled service (same service.name) — for example a multi-tenanted or multi-branded deployment of one binary. Maps to OpenTelemetry resource attribute service.instance.id (surfaces as cloud_RoleInstance and customDimensions["service.instance.id"] in Application Insights).

Resolution order if this property is null:

  1. OTEL_RESOURCE_ATTRIBUTES env var (parsed for service.instance.id=...).
  2. QUILT4NET_SERVICE_INSTANCE_ID env var.
  3. Falls back to MachineName on the OTel resource (today's behaviour) and absent from per-record customDimensions — no breaking change for existing consumers.
public string ServiceInstanceId { get; set; }

Property Value

string

Version

Application version. Maps to OpenTelemetry resource attribute service.version (surfaces as application_Version in Application Insights). Default is the entry assembly version.

public string Version { get; set; }

Property Value

string