LogEvent Main Topic| Next
LogEvent Syntax
logevent
[-m \\\ComputerName]
[-s Severity]
[-c CategoryNumber]
[-r Source]
[-e EventID]
[-t TimeOut]
"Event Text"
Where:
- -s Severity
- Severity is one of the following:
- (S)uccess
- (I)nformation
- (W)arning
- (E)rror
- (F)ailure
The default is "Information".
- -m \\ComputerName
- Name of the computer on which the event should be logged.
- -c CategoryNumber
- Category number. The default is 0.
- -r Source
- Source is a string-which can be quoted-for the event's source. default is "User Event".
- -e EventID
- EventID is an integer for the event's Event ID (0-65535). Default is 1.
- -t TimeOut
- TimeOut is the number of seconds the system waits before exit. default is 60000.
- "Event Text"
- Names that include space characters must be enclosed in double quotes.
Example:
logevent -m \\server -s E -c 3 -r "User Event" -e 42 "My message."
The following table shows how LogEvent switches map to Event Viewer.
Event Viewer Application Log Event Properties |
Type | -s Severity |
Date | |
Source | -r Source |
Time | |
Category | -c CategoryNumber |
Event ID | -e EventID |
User | |
Computer | -m \\ComputerName |
Description | "Event Text" |