BCQuality rule · privacyAL Developmentofficial - Microsoftderived - from the source, no model text

FeatureTelemetry.LogError emits more than caller custom dimensions

FeatureTelemetry.LogError emits its ErrorText as the telemetry message and adds it as alErrorText. The overloads with ErrorCallStack also add alErrorCallStack.

Rule on GitHub · microsoft layer · privacy · BC 18.. · tier official · derived

Description

FeatureTelemetry.LogError emits its ErrorText as the telemetry message and adds it as alErrorText. The overloads with ErrorCallStack also add alErrorCallStack. These dimensions are produced in addition to the caller-supplied CustomDimensions dictionary, and the Feature Telemetry implementation sends the event as SystemMetadata.

Best Practice

Review the dedicated error arguments as telemetry payload. Capture GetLastErrorText(true) when scrubbed platform error text is sufficient, and pass GetLastErrorCallStack() only as a call stack. Keep custom dimensions non-personal too.

See sample: featuretelemetry-logerror-implicit-errortext.good.al.

Anti Pattern

Approving a LogError call because its explicit dictionary contains only safe values while it passes unsanitized GetLastErrorText() or arbitrary context through ErrorText or ErrorCallStack. Those arguments become telemetry dimensions outside the dictionary.

See sample: featuretelemetry-logerror-implicit-errortext.bad.al.

Examples

Names

Changed by


From microsoft/BCQuality at a4593a1, MIT License, Copyright (c) 2026 Microsoft Corporation (license).