Udostępnij za pośrednictwem


SENDTRACETAG Function

Sends a telemetry trace event to the event log.

Syntax

SENDTRACETAG(Tag, Category, Verbosity, Message)  

Parameters

Tag
Type: Text or code

Specifies an identifier of the trace event. The tag can consist of letters, numbers, and special characters. Dynamics NAV system telemetry events use an auto-generated, auto-incremented, 7-character tag that includes numbers and letters, such as 000002Q. and 000013P. Try to make your tags unique from these telemetry event tags by, for example, using at least 8 characters or a prefix, like Cronus-0001 and Cronus-0002.

Category
Type: Text or code

Specifies category for the telemetry trace.

Verbosity
Type: Verbosity

Specifies the level of the event. You can set this parameter to either Critical, Error, Warning, Normal, or Verbose.

Message
Type: Text or code

Specifies the descriptive message for the telemetry trace event.

These values correspond to values of the DataClassification property on table objects and fields. Like the DataClassification property, you can use the DataClassification parameter to help comply with legislative requirements for collecting, storing, and using user personal information.

Important

If you do not set the DataClassification, the telemetry trace event is automatically classified as CustomerContent.

Remarks

You use the SENDTRACETAG function for instrumenting the application for telemetry. When the SENDTRACETAG function 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.

For more information about instrumenting and monitoring telemetry, see Instrumenting an Application for Telemetry and Monitoring-Dynamics NAV Server Events.

Example

The following code defines simple telemetry events for the five different severity levels.

SENDTRACETAG('Cronus-0001', 'Action', VERBOSITY::Critical, 'This is a critical message.');
SENDTRACETAG('Cronus-0002', 'Action', VERBOSITY::Error, 'This is an error message.');
SENDTRACETAG('Cronus-0003', 'Action', VERBOSITY::Warning, 'This is a warning message.');
SENDTRACETAG('Cronus-0004', 'Action', VERBOSITY::Normal, 'This is an informational message.');
SENDTRACETAG('Cronus-0005', 'Action', VERBOSITY::Verbose, 'This is a verbose message.');

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.

See Also

Instrumenting an Application for Telemetry