다음을 통해 공유


심각도 수준 정의

수준은 이벤트를 그룹화하고 일반적으로 이벤트의 심각도 또는 세부 정보를 나타내는 데 사용됩니다. 수준을 정의하려면 level 요소를 사용합니다. Winmeta.xml 파일은 일반적으로 사용되는 다음과 같은 심각도 수준을 정의합니다.

  • win:Critical
  • win:Error
  • win:Warning
  • win:Informational
  • win:Verbose

소비자는 수준을 사용하여 특정 수준 값이 포함된 이벤트를 쿼리합니다. ETW 추적 세션은 수준을 사용하여 이벤트 추적 로그 파일에 기록되는 이벤트를 제한할 수도 있습니다. 수준 값이 지정된 수준 값보다 크거나 작은 이벤트는 로그 파일에 기록됩니다. 예를 들어 세션이 win:Warning에 대한 수준 값을 지정한 경우 로그 파일에는 경고, 오류 및 중요한 이벤트가 포함됩니다.

다음 예제에서는 수준을 정의하는 방법을 보여줍니다. 수준의 이름 특성을 지정해야 합니다. 특성의 값은 16에서 255까지의 범위에 있어야 합니다. 기호메시지 특성은 선택 사항입니다.

<instrumentationManifest
    xmlns="http://schemas.microsoft.com/win/2004/08/events" 
    xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    >

    <instrumentation>
        <events>
            <provider name="Microsoft-Windows-SampleProvider"
                guid="{1db28f2e-8f80-4027-8c5a-a11f7f10f62d}"
                symbol="PROVIDER_GUID"
                resourceFileName="<path to the exe or dll that contains the metadata resources>"
                messageFileName="<path to the exe or dll that contains the string resources>"
                message="$(string.Provider.Name)">

                . . .

                <levels>
                    <level name="NotValid"
                           value="16"
                           symbol="LEVEL_SAMPLEPROVIDER_NOTVALID"
                           message="$(string.Level.NotValid)"/>
                    <level name="Valid"
                           value="17"
                           symbol="LEVEL_SAMPLEPROVIDER_VALID"
                           message="$(string.Level.Valid)"/>
                </levels>

                . . .

            </provider>
        </events>
    </instrumentation>

    <localization>
        <resources culture="en-US">
            <stringTable>
                <string id="Provider.Name" value="Sample Provider"/>
                <string id="Level.Valid" value="Valid"/>
                <string id="Level.NotValid" value="Not Valid"/>
            </stringTable>
        </resources>
    </localization>

</instrumentationManifest>