This repository contains an example manifest for creating a custom event provider for the windows event log. This provider was inspired by the Stack Overflow question How to store an object in the Windows Event Log?
Most of the content for this manifest came from an article by Daniel Gordon In fact, the steps come directly from his article. I made modifications to his manifest file to represent the details of the Stack Overflow question.
- Open a git bash prompt and cd to
c
- Clone the repository and cd to cloned directory location.
- Open a Visual Studio Command Prompt and cd to C:\CustomProvider
- Compile the manifest:
mc -css Namespace CustomProvider.man
- Create the resource file:
rc CustomProvider.rc
- Compile the source:
csc /target:library /unsafe /win32res:CustomProvider.res CustomProvider.cs
- Register the provider.
wevtutil im CustomProvider.man
- You'll now see the custom provider in the Windows Event Viewer
- To write to the log, open a Windows Powershell prompt and execute
New-WinEvent -ProviderName CustomProvider -Id 10000 -Payload @("MyValue1")
then refresh the event log and you'll see the event.
- Congratulations, you've created a custom provider thanks to this repository and Daniel Gordon