What is custom events? How to create it?

Posted by Deepak under C# on 2/5/2009 | Views : 1959 | Status : [Member] | Replies : 1
What is custom events? How to create it?


Posted by: Syedshakeer on: 2/5/2009 [Member] Starter

This step-by-step article describes how to create custom events . You can create custom events in an event log by using the Eventcreate utility. This can be useful as a diagnostic tool in scripts when you record an error or event directly into the logs without using VBScript or another language to log the event.

The Eventcreate utility
Eventcreate is a command-line utility that you can start at a command prompt or by clicking Start and then typing in the Run dialog box. The following switches are available for the command:

* /s computer
Specifies the name or IP address of a remote computer with which to log the event. The default computer is the local computer.
* /u domain\user
Runs the command with the permissions of the specified user. The default user is the current user.
* /p password
Specifies the password of the user account that is specified in the /u parameter.
* /l
Specifies the name of the log where the event will be created. Only APPLICATION or SYSTEM are permitted.
* /so source name
Specifies the source name that is generating the event, and this can be any string, but is typically the program.
* /t
Specifies the type of event to create. The valid event types are ERROR, WARNING, and INFORMATION.
* /id EventID
Specifies the event ID for the event. This must be an integer between 1 and 1000. IDs do not have to be unique, and it is a good idea to use them to record an identifiable error number such as the exit code from a program.
* /d description
Specifies the description to use for the newly-created event. Use quotation marks (") to specify a multi-word string.
* /?
Displays help at the command prompt.

NOTE: You must supply values for the /t, /id and /d options, and another value for the /l or /so option.

Syed Shakeer Hussain

Deepak, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response