Class Quilt4NetLoggingOptions
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
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
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
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
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
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:
OTEL_RESOURCE_ATTRIBUTESenv var (parsed forservice.instance.id=...).QUILT4NET_SERVICE_INSTANCE_IDenv var.- Falls back to
MachineNameon 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
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; }