# Session.SendTraceTag(Text, Text, Verbosity, Text [, DataClassification]) Method
> Version: _Available or changed with runtime version 1.0 until version 6.0 where it was deprecated for the following reason: "Use LogMessage instead."_
Send a trace tag to the telemetry service.
> NOTE
> This method is supported only in Business Central on-premises.
## Syntax
```al
 Session.SendTraceTag(Tag: Text, Category: Text, Verbosity: Verbosity, Message: Text [, DataClassification: DataClassification])
```
> NOTE
> This method can be invoked without specifying the data type name.
## Parameters
Tag
Type: ../text/text-data-type
The tag.
Category
Type: ../text/text-data-type
The category.
Verbosity
Type: ../verbosity/verbosity-option
The verbosity.
Message
Type: ../text/text-data-type
The message.
*[Optional] DataClassification*
Type: DataClassification<../../../developer>
Classification of data in message.
## Remarks
You 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.
A telemetry event is given one of the following event IDs, depending on the DataClassificationand Verbosity:
|DataClassification|Verbosity|ID|
|All except CustomerContent and EndUserIdentifiableInformation|Critical|700|
||Error|701|
||Informational|702|
||Verbose|704|
||Warning|705|
|CustomerContent or EndUserIdentifiableInformation|Critical|707|
||Error|708|
||Informational|709|
||Verbose|711|
||Warning|712|
> NOTE
> 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>.
## Example
The following code defines simple telemetry events for the five different severity levels.
```al
SendTraceTag('Cronus-0001', 'Action', Verbosity::Critical, 'This is a critical message.', DataClassification::CustomerContent);
SendTraceTag('Cronus-0002', 'Action', Verbosity::Error, 'This is an error message.',  DataClassification::EndUserIdentifiableInformation);
SendTraceTag('Cronus-0003', 'Action', Verbosity::Warning, 'This is a warning message.', DataClassification::AccountData);
SendTraceTag('Cronus-0004', 'Action', Verbosity::Normal, 'This is an informational message.', DataClassification::OrganizationIdentifiableInformation);
SendTraceTag('Cronus-0005', 'Action', Verbosity::Verbose, 'This is a verbose message.', DataClassification::SystemMetadata);
```
The events emitted by this code will have the events IDs (listed in the order that the are called): 707, 708, 705, 702, and 704.
## Related information
session-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

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. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/session/session-sendtracetag-method/
