次の方法で共有


Microsoft Dynamics NAV Server Trace Events

This topic describes the trace events that are generated by Microsoft Dynamics NAV server.

The following list provides useful information about event tracing.

  • The event trace provider is Microsoft-DynamicsNAV-Server. You typically need to provide this name in the monitoring tool that you are using.

  • There are four types of trace events: Windows event log, SQL traces, service calls, and C/AL function calls. 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 most 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. For more information, see Event Trace Data.

Windows Event Log Trace Events

Windows Event Log trace events track errors, warnings, and information messages that provide information about the condition or state of Microsoft Dynamics NAV Server instances. These events are also logged in the Windows Application event log of the computer that is running Microsoft Dynamics NAV Server. For a complete list of the events, see Monitoring Microsoft Dynamics NAV Server Events in the Windows Event Log.

Keyword Decimal value Hexadecimal value

EventViewer

1

0x1

SQL Trace Events

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

Keyword Decimal value Hexadecimal value

SQLTracing

2

0x2

The event data that is collected includes: session ID, tenant ID, the Microsoft Dynamics NAV user, and the SQL statement. For more information, see Event Trace Data.

The following table lists the SQL trace events.

ID Event (task/opcode) What is traced

1

ExecuteScalar/Start

SQL statements that query a database table and return a single field from a row in the query result.

2

ExecuteScalar/Stop

3

ExecuteNonQuery/Start

SQL statements that return a number of rows from a database table

4

ExecuteNonQuery/Stop

5

ExecuteReader/Start

SQL statements that return a set of rows from a database table.

6

ExecuteReader/Stop

7

ReadNextResult/Start

SQL statements that return the next result from a database query.

8

ReadNextResult/Stop

9

ReadNextRow/Start

SQL statements that return the next row in database table.

10

ReadNextRow/Stop

11

BeginTransaction/Start

SQL statements that start a database transaction.

12

BeginTransaction/Stop

13

Prepare/Start

SQL statements that create a prepared version of the command on an instance of SQL Server.

14

Prepare/Stop

15

OpenConnection/Start

SQL statements that open connection to the database from the connection pool.

16

OpenConnection/Stop

17

Commit/Start

SQL statements that commit a database transaction.

18

Commit/Stop

19

Rollback/Start

SQL statements that cancel the changes in a pending database transaction.

20

Rollback/Stop

Service Call Trace Events

Service call trace events track when Microsoft Dynamics NAV clients run the Microsoft Dynamics NAV objects: Queries, Reports, and XMLports.

Keyword Decimal value Hexadecimal value

ServiceCall

4

0x4

The event data that is collected includes: session ID, tenant ID, Microsoft Dynamics NAV user, and the Microsoft Dynamics NAV object ID. For more information, see Event Trace Data.

The following table lists the service call trace events.

ID Event (task/opcode) What is traced

300

RunQuery/Start

Microsoft Dynamics NAV Query objects that are opened and closed.

301

RunQuery/Stop

302

RunReport/Start

Microsoft Dynamics NAV Report objects that are opened and closed.

303

RunReport/Stop

310

RunXmlPort/Start

Microsoft Dynamics NAV XMLport objects that are opened and closed.

311

RunXmlPort/Stop

500

OpenSession

Microsoft Dynamics NAV Windows clients and Microsoft Dynamics NAV Web clients establish a connection to the Microsoft Dynamics NAV Server instance.

501

CloseSession

C/AL Function Trace Events

C/AL function tracing events track the execution of C/AL functions and statements on the Microsoft Dynamics NAV Server instance.

Keyword Decimal value Hexadecimal value

ALTracing

8

0x8

The event data that is collected includes: session ID, tenant ID, Microsoft Dynamics NAV user, C/ALC/AL function, C/AL statements, and line number. For more information, see Event Trace Data.

Important

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

The following table lists the C/AL function tracing events.

ID Event (task/opcode) What is traced

400

ExecuteALFunction/Start

C/AL functions that are called.

401

ExecuteALFunction/Stop

402

ExecuteALFunctionFailed

Errors that occur when executing C/AL functions. The errors can be caused by exceptions or ERROR Function (Dialog) calls.

403

ExecuteALFunction

C/AL statements that are executed.

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.

Argument Description Trace event type

connectionType

Specifies the RoleTailored client that has established the connection to the Microsoft Dynamics NAV server instance. Values include Microsoft Dynamics NAV Windows client and Microsoft Dynamics NAV Web client.

Service calls

failureMessage

Includes the error message that is returned when a C/AL function fails.

C/AL function trace events

functionName

Specifies the C/AL function that was executed.

C/AL function trace events

lineNumber

Specifies the line number of the statement in the C/AL code of the Microsoft Dynamics NAV object that was executed.

C/AL function trace events

message

Specifies the error, warning, or information message text that was issued for a Windows event log trace on the Microsoft Dynamics NAV Server.

Windows event log trace events

objectId

Specifies the ID of the Microsoft Dynamics NAV object that was executed in the session.

Service calls trace events

C/AL function trace events

objectType

Specifies the Microsoft Dynamics NAV object type that executed by a C/AL function or statement. Values include the following: CodeUnit, Page, Query, Report, Table, and XMLport.

C/AL function trace events

sessionId

Specifies the ID that is assigned to the session that is used by the operation. Each operation establishes a session with the Microsoft Dynamics NAV Server instance from a connection in the Microsoft Dynamics NAV Server's connection pool.

All

sqlStatement

Specifies the SQL statement that was executed on the session.

SQL trace events

statement

Specifies the C/AL statement that was executed on the session.

C/AL function trace events

tenantId

Specifies the ID of the tenant database that is mounted on the Microsoft Dynamics NAV Server instance. If the Microsoft Dynamics NAV Server instance is not configured for multitenancy, then the value is empty. For more information about multinenancy, see Multitenant Deployment Architecture.

All

userName

Specifies the Microsoft Dynamics NAV user account that is logged on to the session.

All

See Also

Concepts

Monitoring Microsoft Dynamics NAV Server Event Traces
Monitoring Microsoft Dynamics NAV Server Events