【问题标题】:Channel Names for ETW ProvidersETW 提供者的频道名称
【发布时间】:2012-11-01 09:47:45
【问题描述】:

我正在尝试让我的 Windows 事件跟踪 (ETW) 提供程序清单来注册正确的通道名称。当我使用清单(包括在下面)时,我得到以下结果。但是,当我检查我的清单与注册表中 All-User-Install-Agent 清单(存储在 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT 中)的结果之间的差异时,我没有看到为什么我的键以 Foo-Bat-TestApp/ 前缀显示。如何摆脱前缀?我无法从名称属性中删除它们,因为已经有一个使用“操作”名称的操作系统组件(它是注册表中的一个平面列表)。

我的示例清单如下所示:

<?xml version="1.0" encoding="utf-16"?>
<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="Foo-Bar-TestApp"
                guid="{C5C633DC-FB7E-4EA0-80EC-C683FA52561C}"
                symbol="EtwProvider"
                resourceFileName="C:\Projects\ETWTest\bin\Debug\ETWTest..dll"
                messageFileName="C:\Projects\ETWTest\bin\Debug\ETWTest.dll">
        <channels>
          <channel name="Foo-Bar-TestApp/Admin"
                   chid="Admin"
                   type="Admin"
                   enabled="true" />
          <channel name="Foo-Bar-TestApp/Operational"
                   chid="Operational"
                   type="Operational"
                   enabled="true" />
          <channel name="Foo-Bar-TestApp/Debug"
                   chid="Debug"
                   type="Debug"
                   enabled="false" />
        </channels>
        <keywords>
          <keyword name="KeywordA" symbol="READ_KEYWORD" mask="0x1" />
          <keyword name="KeywordB" symbol="WRITE_KEYWORD" mask="0x2" />
        </keywords>
       <events>
          <event version="1"
                 value="1"
                 symbol="SampleEvent"
                 channel="Operational"
                 level="win:Informational"
                 message="$(string.Event.SampleEvent)"
                 keywords="KeywordA" />
        </events>
      </provider>
    </events>
  </instrumentation>
  <localization>
    <resources culture="en-US">
      <stringTable>
        <string id="Event.SampleEvent" value="This is a sample event"/>
      </stringTable>
    </resources>
  </localization>
</instrumentationManifest>

【问题讨论】:

    标签: windows winapi event-log etw


    【解决方案1】:

    为了实现所需的功能,您必须在通道定义上使用符号属性。请参阅以下示例:
    <channel name="Admin" symbol="Foo-Bar-TestApp-Admin" chid="Admin" type="Admin" enabled="true" />

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-01
      • 2018-10-20
      • 1970-01-01
      • 2020-12-09
      • 2011-05-20
      • 2015-10-22
      • 1970-01-01
      相关资源
      最近更新 更多