ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Service functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
ServiceWriteEventLog (Function)
In french: ServiceEcritEvénementJournal
Writes an event into the log of Windows events.
Remark: 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
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:
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, ...
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.
<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
  • 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).
Component: wd290vm.dll
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help