Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 3.67 KB

loggingchannel.md

File metadata and controls

41 lines (28 loc) · 3.67 KB
-api-id -api-type
T:Windows.Foundation.Diagnostics.LoggingChannel
winrt class

Windows.Foundation.Diagnostics.LoggingChannel

-description

Represents a source of log messages.

-remarks

The default LoggingLevel is Verbose.

Add LoggingChannel instances to a LoggingSession or a FileLoggingSession to enable logging in your app.

The LogMessage methods provide ways to log simple string messages, while the LogEvent methods provide ways to log more complex tracing data.

Windows 10 Two modes of operation are now supported: Windows 8.1 compatibility mode and the new behavior supported by Windows 10 and later which allows you to log self-describing Event Tracing for Windows (ETW) events without a manifest. + For Windows 8.1 compatibility mode, create the object using the LoggingChannel(String) constructor.

Windows 8.1 compatibility modeWindows 10 and later specific behavior
Some **LoggingChannel** events may reference the 4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a which is the [GUID](/windows/win32/api/guiddef/ns-guiddef-guid) for the **Microsoft-Windows-Diagnostics-LoggingChannel** manifest that is available on Windows 8.1 or later.All events are self-describing. No manifest is required.
The [Id](loggingchannel_id.md) property is always 4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a, which is the GUID for the **Microsoft-Windows-Diagnostics-LoggingChannel** manifest.The [Id](loggingchannel_id.md) property varies based on how the channel is constructed. If the [LoggingChannel(String, LoggingChannelOptions)](loggingchannel_loggingchannel_1496214966.md) constructor is used, the **Id** is determined by hashing the name parameter. If the [LoggingChannel(String, LoggingChannelOptions, Guid)](loggingchannel_loggingchannel_2599058.md) constructor is used, the specified *id* parameter is used.
Events generated by the **LogMessage**, **LogValuePair**, the [LoggingActivity](loggingactivity_loggingactivity_1858772704.md) constructors or destructor, or activity.[Activity.Close ](loggingactivity_close_811482585.md) method use manifest-based event encoding. All other events use self-describing TraceLogging event encoding.All events use self-describing TraceLogging event encoding.
The channel provider name is Microsoft-Windows-Diagnostics-LoggingChannel. The channel name is recorded in each event in the payload field **LoggingChannelName**.The channel name is used as the provider name. Events will not have a **LoggingChannelName** field.

-examples

-see-also

LoggingSession, FileLoggingSession, ILoggingChannel, IClosable, Logging sample (Windows 10)