|
|
|
|
|
ServiceWriteEventLog (Function) In french: ServiceEcritEvénementJournal Writes an event into the log of Windows events. Note This function is ignored if it is not called in a "Windows Service" application.
HOpenConnection(ConnexionSrv)
IF ErrorOccurred = True THEN
ServiceWriteEventLog("Erreur détectée lors de la connexion à la base de données" + ...
CR + ErrorInfo(), elError)
RETURN False
END
Syntax
ServiceWriteEventLog(<Message> [, <Type of event> [, <Event Identifier>]])
<Message>: Character string Description of the event. This text can be re-read from the event observer by displaying the details of the event. <Type of event>: Optional Integer constant Type of event that will be written into the Windows log: | | elError | Error event. Signals an error while running a service. Services have no way of displaying information, so this is the main way of reporting a problem. | elInformation (default value) | Information event. Indicates the status of service. For example: change of activity mode, start-up, ... | elWarning | Warning event. Indicates that a non fatal error occurred while running the service. For example: an operation was successful, but a notification message could not be sent. |
<Event Identifier>: Optional integer Event identifier (found between 1 and 100). Tip Use a different value for each service event to differentiate them easily. This value can be retrieved by the applications that read the event log in order to trigger actions. Remarks - Events generated by ServiceWriteEventLog are written to the "Application" log of the operating system.
- The log can be re-read:
- by using the event observer (found among the management tools of Windows).
- through programming (by using the "WD EventLog" component provided with WINDEV for example).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|