title | ms.custom | ms.date | ms.reviewer | ms.service | ms.topic | author | ||
---|---|---|---|---|---|---|---|---|
How to: Use Logman to Collect Event Trace Data |
|
04/16/2024 |
jswymer |
dynamics-365-op |
conceptual |
jswymer |
This article describes how to use logman to collect event trace data for [!INCLUDEserver]. Logman (logman.exe) comes with the Windows Operating System. You can use it to create and manage event trace session and performance logs from the command prompt.
This article provides a brief introduction to using logman to collect trace event data for [!INCLUDEserver] and telemetry events. For more detailed information about logman, see Logman.
You can collect [!INCLUDEserver] trace event data from two different trace event providers: Microsoft-DynamicsNAV-Server and Microsoft-DynamicsNAV-Common. Microsoft-DynamicsNAV-Server is used for trace events like SQL traces, AL function traces, and session calls. Microsoft-DynamicsNAV-Common is used for telemetry events.
Data that is collected with logman is stored in an event trace log (.etl) file.
The following steps give you an example of how to use logman.
-
Open the command prompt, and change to the directory that contains the
logman.exe
file.This is typically
C:\Windows\System32
-
At the command prompt, run one of the following commands to create a trace data collector.
For telemetry trace events:
logman create trace MyTelemetryTraceData -p Microsoft-DynamicsNAV-Common -o c:\perflogs\MyTelemetryTraceData.etl
For server trace events:
logman create trace MyServerTraceData -p Microsoft-DynamicsNAV-Server -o c:\perflogs\MyServerTraceData.etl
These commands will create event log files named
MyTelemetryTraceData.etl
andMyServerTraceData.etl
in thec:\perflogs
folder of your computer. -
To start the trace session, run one of the following commands.
For telemetry trace events:
logman start MyTelemetryTraceData
For server trace events:
logman start MyServerTraceData
-
To stop the trace session, run one of the following commands.
For telemetry trace events:
logman stop MyTelemetryTraceData
For server trace events:
logman stop MyServerTraceData
The data is now stored in an .etl file.
There are various industry tools available for viewing data in .etl files.
For example, from the command line, you can use the tracerpt command to create dump files, summary, and report files. The following code creates files for the MyTelemetryTraceData_000001.etl file:
tracerpt c:\perflogs\MyTelemetryTraceData_000001.etl -o c:\perflogs\MyTelemetry-dmp.xml -of XML -summary c:\perflogs\MyTelemetry-summary.txt -report c:\perflogs\MyTelemetry-rpt.xml
You can also use PerView. For more information, see Use PerfView to View Event Trace Data.
Monitoring Business Central Server Events
Business Central Server Trace Events
Instrumenting an Application for Telemetry