Built-in functions / Built-in functions |
Initializes error logging and opens the error log file passed as the parameter.
Call STARTLOG() in the MAIN program block to open or create an error log file. After STARTLOG() has been invoked, a record of every subsequent error that occurs during the program execution is written in the error log file.
The format of the error records appended to the error log file after each subsequent error is as follows:
Date: 03/06/99 Time: 12:20:20 Program error at "stock_one.4gl", line number 89. SQL statement error number -239. Could not insert new row - duplicate value in a UNIQUE INDEX column. SYSTEM error number -100 ISAM error: duplicate value for a record with unique key.
To report specific application errors, use the ERRORLOG() function to make an entry in the error log file.
If the argument of STARTLOG() is not the name of an existing file, STARTLOG() creates a new one. If the file already exists, STARTLOG() opens it and positions the file pointer so that subsequent error messages can be appended to this file.
CALL STARTLOG("/var/myapp/logs/error-" || fgl_getpid() || ".log") ... CALL ERRORLOG("The current user is not allowed to perform order validation")