Putting XML Data into the Windows Event Log

孤街浪徒 提交于 2019-11-28 12:32:29

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.

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).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!