Log file is a file that records either events that occur when applications are run or messages sent between different computer systems and tools.
Log files are generally used for testing, debugging, and troubleshooting.
There are several groups of logs created by different Lycia components:
By default = immediately after you have installed Lycia:
Error logs (also called startlogs) are log files initialized by the 4GL developer from a 4GL application.
Error logs store error messages obtained when your 4GL applications are run.
Error logs are created by startlog() - the function that initializes error logging and opens the error log file:
CALL startlog("new_program")
CALL startlog("new_program.txt")
CALL startlog("C:\my_work\my_logs\new_program.txt")
If the path you specified for storing error logs doesn't exist, Lycia will create it automatically.
If you do not specify the path, error log will be stored in the same folder as the executable file of the program, in which the error log is initialized.
Error logs get their entries by errorlog(). This means that error logs can include not only error messages but also user messages added by the 4GL developer to the 4GL code by errorlog().
Details of the error message depend on what object_cache is used - release or debug.
With release cache, line info is usually excluded:
Date: 04/16/2025 Time: 13:17:26
An exception (error) is being handled.
The error code (9230) was received.
Invalid form: root container is missing
Form new_program is invalid. Root container is missing.
With debug cache, line info is included:
Date: 04/16/2025 Time: 13:17:26
An exception (error) is being handled.
Module: new_program.exe [0000000a]
File: new_program.4gl
line 3 (1-12)
Function: main
The error code (9230) was received.
Invalid form: root container is missing
Form new_program is invalid. Root container is missing.
If necessary, you can switch on the line info for release cache by setting the QX_REL_LINE_INFO environment variable before building the object_cache:
QX_REL_LINE_INFO=1
Error messages written to error logs also depend on the WHENEVER statement. For example, with WHENEVER ANY ERROR CONTINUE, errors will be skipped, and runtime and error messages will not be written to error logs.
Error logs are appended after every application launch:
Date: 12/28/2024 Time: 13:17:26
An exception (error) is being handled.
The error code (9230) was received.
Invalid form: root container is missing
Form new_program is invalid. Root container is missing.
Date: 12/28/2024 Time: 13:23:55
An exception (error) is being handled.
The error code (9230) was received.
Invalid form: root container is missing
Form new_program is invalid. Root container is missing.
Date: 12/28/2024 Time: 13:28:08
An exception (error) is being handled.
The error code (9230) was received.
Invalid form: root container is missing
Form new_program is invalid. Root container is missing.
You can also write to the error logs file using errorlog():
CALL errorlog("Unexpected error encountered")
or
CALL errorlog(err_get(-999))
Application logs (also called qrun logs or runtime logs) are logs initialized at the moment of application launch.
Application logging is initialized (and a log file is created) every time you run the application.
Application log files are located in the folder specified in listener.xml by the tag <logdir>...</logdir>. By default, it is:
The name of the application log files includes the application name and the timestamp:
<application_name>.<timestamp>.log
For example,
test.exe.2017-12-28_21.36.30.814.log
The content of an application log file is determined by these environment variables:
If the inet.env configuration file is not generated, you should create it and set the QXDEBUG environment variable set to QXDEBUG=mv.
If you do not change the inet.env, then your application log will include:
By setting environment variables, you can make application logs more detailed:
|
logs the debugging results, for example:
|
|
|
switches on line info for release cache |
|
|
specifies the logging level for the application. Allow logging:
|
|
|
enables tracing of function calls for user-defined functions |
|
|
enables tracing of both function calls for user-defined functions and their arguments |
|
|
specifies how many last log messages are written to the application log file when an application crashes |
To include object_cache information to the application logs, you must set these environment variables and their values to inet.env:
QXDEBUG=PzVzT
LYCIA_SEVERITY=TRACE
QX_TRACE=1
QX_TRACE_ARG_DUMP=1
Web server logs are log files that log the operation of the application server (Jetty).
Web server logging is initialized when Querix Lycia Web Application Server is started.
Web server log files are located in the Jetty logs folder:
In its default configuration, Lycia Web Server:
|
commons-daemon.<date>.log |
logs the start of the Querix Lycia Web Application Server |
|
qxweb_7-stderr.<date>.log |
captures and logs all STDERR output |
|
qxweb_7-stdout.<date>.log |
captures and logs all STDOUT output |
Here is an example of commons-daemon.<date>.log file:
[2025-04-16 14:14:36] [info] [ 3032] Commons Daemon procrun (1.0.15.0 64-bit) started
[2025-04-16 14:14:36] [info] [ 3032] Running 'qxweb_7' Service...
[2025-04-16 14:14:36] [info] [ 3672] Starting service...
[2025-04-16 14:14:38] [info] [ 3672] Service started in 1555 ms.