Putting XML Data into the Windows Event Log

前端 未结 2 1670
傲寒
傲寒 2020-12-11 08:32

How can I write XML data into the Windows Event Log?

I have noticed that there is a way to insert XML into the windows event log (and not by just stuffing it into th

相关标签:
2条回答
  • 2020-12-11 08:49

    Unless I am mistaken, in order to write xml to the Crimson/Vista event log you will have create and register a manifest that will give you the appropriate channels and events. Then you have to compile the manifest using the Message Compiler (mc.exe) in the WindowsSDK.

    Then if you want to log from C# you will want to create a managed provider to wrap the event logging API. This is a little harder because you will have to use PInvoke to get at the API.

    There are blog posts on how to do this whole process here.

    0 讨论(0)
  • 2020-12-11 09:00

    You have a sample in Windows SDK (ver 6.1) called EventProvider.
    Its a C# provider (needs Vista and up to work) that uses the new Event log API (AKA crimson).
    This sample show how to add custom data (amount other things).

    0 讨论(0)
提交回复
热议问题