1 create and write the manifest.xml


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

  
<events xmlns="http://schemas.microsoft.com/win/2004/08/events">
   
<!--Publisher Info -->
   
<provider name="DotNetPerformance-TechalWriting-EventLogSample" 
                guid
="{9CDE86C9-DFB9-463f-B2C5-71EEC232A69C}" 
                symbol
="DOTNETPERFORMANCE_TECHNICALWRITING_PUBLISHER" 
                resourceFileName
="C:\adams\etw\Debug\EventLogging.exe" 
                messageFileName
="C:\adams\etw\Debug\EventLogging.exe">

    
<!--Channel to which this Publisher can publish -->
    
<channels>
     
<channel chid="MyOpChannel" 
                        name
="DotNetPerformance-TechalWriting-EventLogSample/Operational" 
                        type
="Operational" 
                        symbol
="DOTNETPERFORMANCEOP" 
                        isolation
="Application" enabled="true"/>
     
<channel chid="MyDebugChannel" 
                        name
="DotNetPerformance-TechalWriting-EventLogSample/Debug" 
                        type
="Debug" 
                        symbol
="DOTNETPERFORMANCEDEBUG" 
                        isolation
="Application" enabled="true"/>
    
</channels>

    
<!--Event Templates -->
    
<templates>
     
<template tid="SimpleEvent" message="$(string.SimpleMessage)">>
      
<data name="Message" inType="win:UnicodeString"/>
      
<UserData>
       
<SimpleEvent xmlns="http://manifests.microsoft.com/win/2004/08/windows/simpleevent">
        
<ExceptionMessage>%1</ExceptionMessage>
       
</SimpleEvent>
      
</UserData>
     
</template>
    
</templates>

    
<events>
     
<event value="1" 
                        level
="win:Informational" 
                        template
="SimpleEvent" 
                        opcode
="win:Info" 
                        channel
="MyOpChannel" 
                        symbol
="DNP_OP_EVENT"
                        message
="$(string.SimpleMessage)"/>
     
<event value="2" 
                   level
="win:Informational" 
                   template
="SimpleEvent" 
                   opcode
="win:Info" 
                   channel
="MyDebugChannel" 
                   symbol
="DNP_DEBUG_EVENT"
                   message
="$(string.SimpleMessage)"/>
    
</events>

   
</provider>

  
</events>

 
</instrumentation>

 
<localization>
  
<resources culture="en-US">
   
<stringTable>
    
<string id="SimpleMessage" value="%1" stringType="string"/>
   
</stringTable>
  
</resources>
 
</localization>
</instrumentationManifest>

相关文章:

  • 2021-11-21
  • 2021-07-22
  • 2021-05-30
  • 2021-08-03
  • 2021-11-13
  • 2022-12-23
  • 2021-05-10
猜你喜欢
  • 2021-08-16
  • 2022-12-23
  • 2021-06-07
  • 2021-09-10
  • 2022-12-23
  • 2021-08-19
  • 2021-05-23
相关资源
相似解决方案