Description
Writes an entry of the specified type with the user-defined eventID and category to the event log, and optionally appends binary data to the message.
-
Return Type
-
None
-
Syntax
-
object.WriteEntry Message, [EntryType], [EventID], [Category], [RawData]
The WriteEntry Method syntax has these parts: |
| object | An expression evaluating to an object of type McEventLog. | | Message | Required. A String value. BSTR : The message to log. Type - mcEventLogEntryType : Type of logging. Default value is mcelNone.
| | EntryType | Optional. A mcEventLogEntryType enumeration, as described in settings. | | EventID | Optional. A Long value. long : A user defined id. Default value is 0.
| | Category | Optional. A Long value. long : A user defined category. Default value is 0.
| | RawData | Optional. A Variant value. VARIANT : An optional buffer to append to the message.
| Settings The settings for EntryType are:
 | mceleError | 1 |
Error events indicate significant problems that the user should know about. Error events usually indicate a loss of functionality or data. For example, if a service cannot be loaded as the system boots, it can log an error event.
|
 | mceleWarning | 2 |
Warning events indicate problems that are not immediately significant, but that may indicate conditions that could cause future problems. Resource consumption is a good candidate for a warning event. For example, an application can log a warning event if disk space is low. If an application can recover from an event without loss of functionality or data, it can generally classify the event as a warning event.
|
 | mceleInformation | 4 |
Information events indicate infrequent but significant successful operations. For example, when Microsoft® SQL Server™ successfully loads, it may be appropriate to log an information event stating that SQL Server has started. Note that while this is appropriate behavior for major server services, it is generally inappropriate for a desktop application (Microsoft® Excel, for example) to log an event each time it starts.
|
 | mceleAuditSuccess | 8 |
Success audit events are security events that occur when an audited access attempt is successful. For example, a successful logon attempt is a success audit event.
|
 | mceleAuditFailure | 16 |
Failure audit events are security events that occur when an audited access attempt fails. For example, a failed attempt to open a file is a failure audit event.
|
 | mceleDebugTrace | 32 |
These audit events are logged only during DEBUG builds.
|
Remarks
The category can be used by an event viewer to filter events in the log.
|