JSI Tip 0347 - Create your own Application Event Log entries from batch jobs.

Jerold Schulman

December 5, 1997

1 Min Read
ITPro Today logo in a gray background | ITPro Today

contain LOGEVENT.EXE which allows a batch job (or command line) to log events to the Application Event Log.

You can log to the local or a remote computer. You must install LOGEVENT.EXE on both the source and destination computer. To install LOGEVENT.EXE, copy it to the %SystemRoot%System32 directory. The first time it is run, it will write User Event entries in the registry (see tip 315).

Usage:

     LOGEVENT [-m \MACHINENAME] [-s SIWEF] [-c CategoryNumber] "Event Text"

where -s indicates severity:
(S)uccess
(I)nformation
(W)arning
(E)rror
(F)ailure

When you run LOGEVENT.EXE, it posts an Event ID 1 to the Applications Event Log as User Event with your Category number and the "Event Text". When you double-click the Event, you get:

The description for Event ID ( 1 ) in Source ( User Event ) could not be found. It contains the following insertion string(s): "Event Text".


Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like