{"title":"Session.SendTraceTag(Text, Text, Verbosity, Text [, DataClassification]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/session/session-sendtracetag-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/session/session-sendtracetag-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/session/session-sendtracetag-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Send a trace tag to the telemetry service.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Session.SendTraceTag(Text, Text, Verbosity, Text [, DataClassification]) Method","slug":"sessionsendtracetagtext-text-verbosity-text-dataclassification-method","at":0,"chars":3042},{"level":2,"title":"Syntax","slug":"syntax","at":350,"chars":224},{"level":2,"title":"Parameters","slug":"parameters","at":574,"chars":331},{"level":2,"title":"Remarks","slug":"remarks","at":905,"chars":1095},{"level":2,"title":"Example","slug":"example","at":2000,"chars":907},{"level":2,"title":"Related information","slug":"related-information","at":2907,"chars":135}],"text":"# Session.SendTraceTag(Text, Text, Verbosity, Text [, DataClassification]) Method\n> Version: _Available or changed with runtime version 1.0 until version 6.0 where it was deprecated for the following reason: \"Use LogMessage instead.\"_\nSend a trace tag to the telemetry service.\n> NOTE\n> This method is supported only in Business Central on-premises.\n## Syntax\n```al\n Session.SendTraceTag(Tag: Text, Category: Text, Verbosity: Verbosity, Message: Text [, DataClassification: DataClassification])\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\nTag\nType: ../text/text-data-type\nThe tag.\nCategory\nType: ../text/text-data-type\nThe category.\nVerbosity\nType: ../verbosity/verbosity-option\nThe verbosity.\nMessage\nType: ../text/text-data-type\nThe message.\n*[Optional] DataClassification*\nType: DataClassification<../../../developer>\nClassification of data in message.\n## Remarks\nYou use the SendTraceTag method for instrumenting the application for telemetry. When the SendTraceTag method called, a telemetry trace event is emitted. The event can then be recorded in the Windows event log or collected by other event trace collection tools, like PerfView, Logman, and Performance Monitor.\nA telemetry event is given one of the following event IDs, depending on the DataClassificationand Verbosity:\n|DataClassification|Verbosity|ID|\n|All except CustomerContent and EndUserIdentifiableInformation|Critical|700|\n||Error|701|\n||Informational|702|\n||Verbose|704|\n||Warning|705|\n|CustomerContent or EndUserIdentifiableInformation|Critical|707|\n||Error|708|\n||Informational|709|\n||Verbose|711|\n||Warning|712|\n> NOTE\n> The SendTraceTag method is marked as obsolete in Business Central 2020 release wave 2 (v17). You can still use it, but we recommend that you send traces to Application Insights using the LOGMessage method instead. See Creating Custom Telemetry Traces for Application Insights Monitoring<../../devenv-instrument-application-for-telemetry-app-insights>.\n## Example\nThe following code defines simple telemetry events for the five different severity levels.\n```al\nSendTraceTag('Cronus-0001', 'Action', Verbosity::Critical, 'This is a critical message.', DataClassification::CustomerContent);\nSendTraceTag('Cronus-0002', 'Action', Verbosity::Error, 'This is an error message.',  DataClassification::EndUserIdentifiableInformation);\nSendTraceTag('Cronus-0003', 'Action', Verbosity::Warning, 'This is a warning message.', DataClassification::AccountData);\nSendTraceTag('Cronus-0004', 'Action', Verbosity::Normal, 'This is an informational message.', DataClassification::OrganizationIdentifiableInformation);\nSendTraceTag('Cronus-0005', 'Action', Verbosity::Verbose, 'This is a verbose message.', DataClassification::SystemMetadata);\n```\nThe events emitted by this code will have the events IDs (listed in the order that the are called): 707, 708, 705, 702, and 704.\n## Related information\nsession-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}