PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
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.
Example
// Attempt to connect to the server of the database
HOpenConnection(SrvConnection)
IF ErrorOccurred = True THEN
ServiceWriteEventLog("Error detected while connecting to the database" + ...
CR + ErrorInfo(), elError)
RESULT False
END
Syntax
ServiceWriteEventLog(<Message> [, <Type of Event> [, <Event Identifier>]])
<Message>: Character string (with quotes)
Description of 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:
elWarningWarning event.
Indicates that a non fatal error occurred while running the service. For example: an operation was successfully performed but no notification message was sent.
elErrorError event.
Signals an error while running a service. Services do not have the mean to display information: therefore, this is the main method for reporting an error.
elInformation
(default value)
Information event.
Indicates the status of service. For example: change of activity mode, startup, ...
<Event Identifier>: Optional integer
Event identifier (found between 1 and 100).
Tip: Use a different value for each event of the service in order to easily differentiate among them.
This value can be retrieved by the applications that read the event log in order to trigger actions.
Remarks
  • The events generated by ServiceWriteEventLog are written into 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).
    • by programming (by using the "WD EventLog" component supplied with WINDEV for example).
Components
WINDEV wd230vm.dll
Minimum required version
  • Version 15
Comments
Click [Add] to post a comment