Skip navigation

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

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


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish