version 6.5
LOG EVENT (message{; importance})
Parameter | Type | Description | |
message | String | Contents of the message | |
importance | Integer | Message's importance level |
Note: This feature is only available on Windows.
Description
The LOG EVENT command allows you to add custom messages that will appear in the Windows Log events. This service maintains a log file that receives and stores messages coming from running applications. It therefore allows you to monitor the course of a worksession. For more information, please refer to the 4D Design Mode manual.
For this feature to be available, Windows Log events service must be running.
Pass the message to write in the log events in message.
You can attribute a level of importance to message, which helps you to read and understand the log events. There are three levels of importance: Information, Warning, and Error. The importance parameter allows you to set the level of importance of the message.
4th Dimension provides you with the following predefined constants, placed in the "Windows Log Events" category:
Constant | Type | Value |
Information Message | Integer | 0 |
Warning Message | Integer | 1 |
Error Message | Integer | 2 |
If you don't pass anything in importance or pass an incorrect value, the default value (0) is used.
Example
If you want to have keep track of when your database is opened, you could write the following line of code in the On Startup Database Method:
LOG EVENT ("The Invoice database was opened.")
Each time the database is opened, this information will be written in Windows' log events and its level of importance will be 0.