LoggingChannel 클래스

정의

로그 메시지의 원본을 나타냅니다.

public ref class LoggingChannel sealed : IClosable
/// [Windows.Foundation.Metadata.Activatable(Windows.Foundation.Diagnostics.ILoggingChannelFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Foundation.Diagnostics.ILoggingChannelFactory2, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class LoggingChannel final : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Foundation.Diagnostics.ILoggingChannelFactory, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.Foundation.Diagnostics.ILoggingChannelFactory2, 65536, "Windows.Foundation.UniversalApiContract")]
class LoggingChannel final : IClosable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Foundation.Diagnostics.ILoggingChannelFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Foundation.Diagnostics.ILoggingChannelFactory2), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class LoggingChannel : System.IDisposable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Foundation.Diagnostics.ILoggingChannelFactory), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Foundation.Diagnostics.ILoggingChannelFactory2), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class LoggingChannel : System.IDisposable
function LoggingChannel(name, options, id)
Public NotInheritable Class LoggingChannel
Implements IDisposable
상속
Object Platform::Object IInspectable LoggingChannel
특성
구현

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

설명

기본 LoggingLevel자세한 정보입니다.

LoggingSession 또는 FileLoggingSessionLoggingChannel 인스턴스를 추가하여 앱에서 로깅을 사용하도록 설정합니다.

LogMessage 메서드는 간단한 문자열 메시지를 기록하는 방법을 제공하지만 LogEvent 메서드는 더 복잡한 추적 데이터를 기록하는 방법을 제공합니다.

Windows 10 이제 두 가지 작업 모드가 지원됩니다. Windows 8.1 호환성 모드와 Windows 10 지원되는 새 동작을 통해 매니페스트 없이 ETW(Windows용 이벤트 추적) 이벤트를 기록할 수 있습니다. + Windows 8.1 호환 모드의 경우 LoggingChannel(String) 생성자를 사용하여 개체를 만듭니다.

Windows 8.1 호환 모드Windows 10 이상 특정 동작
일부 **LoggingChannel** 이벤트는 Windows 8.1 이상에서 사용할 수 있는 **Microsoft-Windows-Diagnostics-LoggingChannel** 매니페스트에 대해 [GUID](/windows/win32/api/guiddef/ns-guiddef-guid)인 4bd2826e-54a1-4ba9-bf63-92b73ea1ac4a를 참조할 수 있습니다.모든 이벤트는 자체 설명입니다. 매니페스트가 필요하지 않습니다.
The

생성자

LoggingChannel(String)

이 생성자는 Windows 8.1 호환 모드에서 LoggingChannel을 만듭니다.

LoggingChannel(String, LoggingChannelOptions)

지정된 옵션을 사용하여 LoggingChannel 클래스의 새 instance 초기화합니다.

LoggingChannel(String, LoggingChannelOptions, Guid)

지정된 옵션 및 채널 ID를 사용하여 LoggingChannel 클래스의 새 instance 초기화합니다.

속성

Enabled

하나 이상의 세션이 이 채널의 이벤트를 로깅하는지 여부를 나타내는 값을 가져옵니다.

Id

이 채널의 공급자 식별자를 반환합니다.

Level

모든 세션이 이 채널의 이벤트를 수신 대기하는 최소 수준을 가져옵니다.

Name

현재 LoggingChannel의 이름을 가져옵니다.

메서드

Close()

현재 로깅 채널에 대한 로깅을 종료합니다.

Dispose()

관리되지 않는 리소스의 확보, 해제 또는 다시 설정과 관련된 애플리케이션 정의 작업을 수행합니다.

IsEnabled()

하나 이상의 세션이 채널의 이벤트를 수신 대기하는지 여부를 나타냅니다.

IsEnabled(LoggingLevel)

하나 이상의 세션이 채널에서 지정된 이벤트 심각도 수준의 이벤트를 수신 대기하는지 여부를 나타냅니다.

IsEnabled(LoggingLevel, Int64)

하나 이상의 세션이 이 채널의 지정된 수준 및 키워드를 사용하여 이벤트를 수신 대기하는지 여부를 나타냅니다.

LogEvent(String)

지정된 이름을 사용하여 이벤트를 기록합니다.

LogEvent(String, LoggingFields)

지정된 이름과 필드를 사용하여 이벤트를 기록합니다.

LogEvent(String, LoggingFields, LoggingLevel)

지정된 이름, 필드 및 수준으로 이벤트를 기록합니다.

LogEvent(String, LoggingFields, LoggingLevel, LoggingOptions)

지정된 이름, 필드, 수준 및 옵션을 사용하여 이벤트를 기록합니다.

LogMessage(String)

현재 LoggingChannel에 메시지를 기록합니다.

LogMessage(String, LoggingLevel)

지정된 LoggingLevel을 사용하여 현재 LoggingChannel에 메시지를 기록합니다.

LogValuePair(String, Int32)

현재 LoggingChannel에 데이터를 기록합니다.

LogValuePair(String, Int32, LoggingLevel)

지정된 LoggingLevel을 사용하여 현재 LoggingChannel에 데이터를 기록합니다.

StartActivity(String)

활동 시작 이벤트를 작성하고 LoggingActivity 개체를 만듭니다.

StartActivity(String, LoggingFields)

지정된 필드를 사용하여 활동 시작 이벤트를 작성하고 LoggingActivity 개체를 만듭니다.

StartActivity(String, LoggingFields, LoggingLevel)

지정된 필드와 수준을 사용하여 활동 시작 이벤트를 작성하고 LoggingActivity 개체를 만듭니다.

StartActivity(String, LoggingFields, LoggingLevel, LoggingOptions)

지정된 필드, 수준 및 옵션을 사용하여 활동 시작 이벤트를 작성하고 LoggingActivity 개체를 만듭니다.

이벤트

LoggingEnabled

로깅 채널이 LoggingSession 또는 기타 이벤트 추적 및 디버깅 도구에 연결될 때 발생합니다.

적용 대상

추가 정보