<< Click to Display Table of Contents >> Navigation: Windows Tools > LogEvent > Usage |
Command Line Parameters
logevent /s <eventsource> /i eventid /c <eventcategory> /<logInformation|logWarning|logError> insertionString1 insertionString2 ...
/s <eventsource> |
The event source under which to log the event (required) |
/i <eventid> |
The event id of the event (required) |
/c <eventcategory> |
The event category of the event (optional). This is a numerical ID that is defined in the event message file that is associated with the event source. |
/logInformation /logWarning /logError |
Log as information event Log as warning event Log as error event |
Examples
Example 1: Log event id 500 from event source "Saturn Surveillance" to the event log with the warning severity
logevent /s "Saturn Surveillance" /i 500 /logWarning
Example 2: Log event id 550 from event source "Milky Way Reporting" with the insertion strings 15:00 and Successful to the event log as an information event
logevent /s "Milky Way Reporting" /i 550 /logInformation 15:00 Successful
In this example, the string "15:00" will be insertion string 1 (%1) and "Successful" will be insertion string 2 (%2). See this article for more information on insertion strings in event messages.