Pages

Wednesday, October 3, 2012

Writing errors in Windows Server application and system event logs for testing

I’ve been assisting clients recently with setting up monitoring on various servers and realized that I haven’t written a post about how to write errors in Windows Server application and system event logs so this post serves to be one that I can reference to in the future when I need to go through this exercise again.

The command supplied within the Windows operating system to create in the event logs is:

eventcreate

More information about this command can be found here:

Eventcreate - TechNet – Microsoft
http://technet.microsoft.com/en-us/library/bb490899.aspx

How to create custom events
http://support.microsoft.com/kb/324145

To quickly write a test error in the application and system event logs of a server, execute the following:

eventcreate /id 999 /t error /l application /d "Test error event in application logs."

eventcreate /l System /id 900 /so Private /d "Test error event in system logs." /t error

clip_image002

Navigating into the application logs will show reveal that an error event with the ID 999 has been created:

image

image

Navigating into the system logs will show reveal that an error event with the ID 999 has been created:

image

image

No comments: