ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Service functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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
// Tentative de connexion au serveur de la base de données
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:
elErrorError 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, ...
elWarningWarning 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).
Component: wd300vm.dll
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help