Business Central Server trace events

APPLIES TO: Business Central on-premises

This article provides an overview of the trace events that are generated by Business Central server instance.

Overview

  • There are two event trace providers that publish different trace events to the event log: Microsoft-DynamicsNAV-Server and Microsoft-DynamicsNAV-Common. The Microsoft-DynamicsNAV-Common provider is strictly for telemetry trace events. All other events use Microsoft-DynamicsNAV-Server. You typically need to specify the event trace provider in the monitoring tool that you are using.

  • There are several types of trace events for each event trace provider, including: Windows event viewer, SQL traces, service calls, AL function calls, and telemetry. Trace event types are identified by a keyword with a corresponding decimal and hexadecimal value. The keywords and values enable you to collect data on specific trace events. Some tools support the hexadecimal values only and other tools support both hexadecimal and decimal.

  • For some trace events, there is separate event for when an operation starts and when it stops. This enables you to determine the duration of the operation. Some monitoring tools, such as PerfView, will automatically return the duration in the stop event.

  • Some monitoring tools might interpret and display the collected event trace differently than others. Learn more in Event Trace Data.

Windows Event Viewer trace events

Windows Event Viewer trace events track errors, warnings, and information messages that provide information about the condition or state of Business Central Server instances. These events can be viewed in the DynamicsNAV channel logs and Application log of Event Viewer on the computer that is running Business Central Server. Learn more in Monitoring Business Central Server Events Using Event Viewer.

Event trace providerKeywordDecimal valueHexadecimal value
Microsoft-DynamicsNAV-ServerEventViewer10x1

For a list and description of EventViewer trace events, consult Business Central Server Admin and Operational Events.

SQL trace events

SQL trace events track a specific set of SQL statements that are executed from the Business Central Server instance against the Business Central database on SQL Server.

Event trace providerKeywordDecimal valueHexadecimal value
Microsoft-DynamicsNAV-ServerSQLTracing20x2

The event data that is collected includes: session ID, tenant ID, the Business Central user, and the SQL statement. Learn more in Event Trace Data.

The following table lists the SQL trace events.

IDEvent (task/opcode)What is traced
1ExecuteScalar/StartSQL statements that query a database table and return a single field from a row in the query result.
2ExecuteScalar/StopSQL statements that query a database table and return a single field from a row in the query result.
3ExecuteNonQuery/StartSQL statements that return a number of rows from a database table
4ExecuteNonQuery/StopSQL statements that return a number of rows from a database table
5ExecuteReader/StartSQL statements that return a set of rows from a database table.
6ExecuteReader/StopSQL statements that return a set of rows from a database table.
7ReadNextResult/StartSQL statements that return the next result from a database query.
8ReadNextResult/StopSQL statements that return the next result from a database query.
9ReadNextRow/StartSQL statements that return the next row in database table.
10ReadNextRow/StopSQL statements that return the next row in database table.
11BeginTransaction/StartSQL statements that start a database transaction.
12BeginTransaction/StopSQL statements that start a database transaction.
13Prepare/StartSQL statements that create a prepared version of the command on an instance of SQL Server.
14Prepare/StopSQL statements that create a prepared version of the command on an instance of SQL Server.
15OpenConnection/StartSQL statements that open connection to the database from the connection pool.
16OpenConnection/StopSQL statements that open connection to the database from the connection pool.
17Commit/StartSQL statements that commit a database transaction.
18Commit/StopSQL statements that commit a database transaction.
19Rollback/StartSQL statements that cancel the changes in a pending database transaction.
20Rollback/StopSQL statements that cancel the changes in a pending database transaction.

Service call trace events

Service call trace events track when Business Central clients run the Business Central objects: Queries, Reports, and XMLports.

Event trace providerKeywordDecimal valueHexadecimal value
Microsoft-DynamicsNAV-ServerServiceCall40x4

The event data that is collected includes: session ID, tenant ID, Business Central user, and the Business Central object ID. Learn more in Event Trace Data.

The following table lists the service call trace events.

IDEvent (task/opcode)What is traced
300RunQuery/StartBusiness Central Query objects that are opened and closed.
301RunQuery/StopBusiness Central Query objects that are opened and closed.
302RunReport/StartBusiness Central Report objects that are opened and closed.
303RunReport/StopBusiness Central Report objects that are opened and closed.
310RunXmlPort/StartBusiness Central XMLport objects that are opened and closed.
311RunXmlPort/StopBusiness Central XMLport objects that are opened and closed.
500OpenSessionDynamics NAV Client connected to Business Centrals and Business Central Web clients establish a connection to the Business Central Server instance.
501CloseSessionDynamics NAV Client connected to Business Centrals and Business Central Web clients establish a connection to the Business Central Server instance.

AL methods trace events

AL function tracing events track the execution of AL functions and statements on the Business Central Server instance.

Event trace providerKeywordDecimal valueHexadecimal value
Microsoft-DynamicsNAV-ServerALTracing80x8

The event data that is collected includes: session ID, tenant ID, Business Central user, AL function, AL statements, and line number. Learn more in Event Trace Data.

Important


If the Business Central Server instance is not configured for full AL function tracing, then only root-level AL function will be traced. Statements and AL functions that are called from functions will not be traced. By default, the Business Central Server instance is not configured for full AL function tracing. For information about how to specify full AL function tracing, see Configuring Business Central Server.

The following table lists the AL function tracing events.

IDEvent (task/opcode)What is traced
400ExecuteALFunction/StartAL functions that are called.
401ExecuteALFunction/StopAL functions that are called.
402ExecuteALFunctionFailedErrors that occur when executing AL functions. The errors can be caused by exceptions or ERROR Function (Dialog) calls.
403ExecuteALFunctionAL statements that are executed.

Important: This trace event is only traced when the Business Central Server is configured to full AL function tracing.

Telemetry trace events

Telemetry trace events can provide data about operations in the application and how it is being used in production. These events include both system telemetry trace events and user-defined, custom telemetry trace events.

Event trace providerKeywordDecimal valueHexadecimal value
Microsoft-DynamicsNAV-CommonTelemetryTracing320x20

Custom telemetry trace events are emitted from the application. These are events that are sent by SENDTRACETAG method calls from inside the application. Learn more about custom telemetry trace events in Instrumenting an Application for Telemetry.

Some of the important event data that is collected for both system and custom telemetry trace events includes: tag, category, message, dataclassification. For more information about this data, see Event Trace Data.

Telemetry events can have one of the following event IDs, based on the data classification and verbosity (or seveity level):

Data classificationVerbosityID
All except CustomerContent and EndUserIdentifiableInformationCritical700
Error701
Informational702
Informational703
Verbose704
Warning705
Informational706
CustomerContent or EndUserIdentifiableInformationCritical707
Error708
Informational709
Informational710
Verbose711
Warning712

Note

Event IDs 703, 706, and 710 are used only for system telemetry trace events. All other IDs are used for both system and custom events.

Event trace data

The following table lists the arguments that make up the data collected for trace events. When viewing event trace data, the way that the arguments are interpreted and displayed can vary depending on the tool that you use.

ArgumentDescriptionTrace event type
categorySpecifies the category of the telemetry trace event.Telemetry (TelemetryData)
connectionTypeSpecifies the RoleTailored client that has established the connection to the Business Central server instance. Values include Dynamics NAV Client connected to Business Central and Business Central Web client.Service calls (ServiceCall)
dataclassificationSpecifies the RoleTailored client that has established the connection to the Business Central server instance. Values include Dynamics NAV Client connected to Business Central and Business Central Web client.Service calls (ServiceCall)
failureMessageIncludes the error message that is returned when a AL function fails.AL function trace events (ALTracing)
functionNameSpecifies the AL function that was executed.AL function trace events (ALTracing)
lineNumberSpecifies the line number of the statement in the AL code of the Business Central object that was executed.AL function trace events
messageSpecifies the error, warning, or information message text that was issued for a trace eventWindows event log trace events (EventViewer)

Telemetry (TelemetryData)
objectIdSpecifies the ID of the Business Central object that was executed in the session.Service calls trace events (ServiceCall)

AL function trace events (ALTracing)
objectTypeSpecifies the Business Central object type that executed by a AL function or statement. Values include the following: CodeUnit, Page, Query, Report, Table, and XMLport.AL function trace events (ALTracing)
sessionIdSpecifies the ID that is assigned to the session that is used by the operation. Each operation establishes a session with the Business Central Server instance from a connection in the Business Central Server's connection pool.All
sqlStatementSpecifies the SQL statement that was executed on the session.SQL trace events (SQLTracing)
statementSpecifies the AL statement that was executed on the session.AL function trace events
tagSpecifies the ID of the telemetry trace event. For system telemetry trace events, this ID is autogenerated. For custom telemetry trace events, it is user-defined.Telemetry (TelemetryData)
tenantIdSpecifies the ID of the tenant database that is mounted on the Business Central Server instance. If the Business Central Server instance is not configured for multitenancy, then the value is empty. For more information about multinenancy, see Multitenant Deployment Architecture.All
userNameSpecifies the Business Central user account that is logged on to the session.All

Monitoring Business Central Server Events
Classifying Data