Using TraceLogging

The following topics provide a TraceLogging quick start for native and managed code, with examples.

Prerequisites

  • Windows 10 Software Development Kit (SDK) is required to write a user-mode provider
  • Windows Driver Kit (WDK) is required to write a kernel-mode provider

In this section

Topic Description
TraceLogging C/C++ Quick Start
The following section describes the basic steps required to add TraceLogging to native user-mode code.
TraceLogging Managed Quick Start
The following section describes the basic steps required to add TraceLogging to managed code.
Record and Display TraceLogging Events
Record TraceLogging events with the Windows Performance Recorder (WPR) and view them with the Windows Performance Analyzer (WPA).
C/C++ Tracelogging Examples
This topic contains C/C++ Tracelogging examples.
.NET Tracelogging Examples
This topic contains a managed code Tracelogging example that illustrates how to log an event only when the session verbosity level is verbose, and how to log structured event data.
Universal Windows Platform Logging Example
This sample shows how to use the Logging APIs in the Windows.Foundation.Diagnostics namespace, including LoggingChannel, LoggingActivity, LoggingSession, and FileLoggingSession. These classes are designed for diagnostic logging within a Windows app. These APIs were added in Windows 8.1.
The LoggingChannel and LoggingActivity APIs have been extended in Windows 10 to support writing complex events using TraceLogging event encoding.
The Universal Windows Platform logging example can downloaded from GitHub.

TraceLogging samples.

TraceLogging for kernel-mode drivers and components