Enabling ABL to SQL Correlation in Logging
- Last Updated: March 17, 2025
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
The Enhanced Logger allows ABL to SQL correlation so that you can compare ABL database requests with SQL directives that are executed on the server.
In the DataServer log file, ABL to SQL correlation includes information from
the client context, the ABL module and line number, along with the
server context SQL that was generated based on the ABL code and
run against the foreign data source. The correlation is enabled
using the -Dsrv PRGRS_LOG_ABL,n switch where n ranges from 0 to 2,
as demonstrated in the following example:
|
For a DataServer broker instance, the SQL log entry type can be set by using
the -Dsrv logentrytypes,SQL switch in the
‘srvrStartupParam' property under the UBroker.MS section in
OpenEdge Explorer or ubroker.properties files or using the parameter
file .pf.
The following table describes the PRGRS_LOG_ABL connect option values:
| Option Value | Description |
|---|---|
| 0 | Disables the ABL to SQL correlation feature. No correlation information will be logged. |
| 1 | Enables the ABL to SQL correlation feature for SQL-related log entry types. Every SQL request derived from the log entry type output is preceded by ABL filename and line number which can be correlated to a compiled listings file. |
| 2 | Enables a superset of value 1 which, along with correlation information, includes visual delimiters marking the start and end of each ABL file module. |
SQL log entry type is specifically designed to output SQL-related
logging information and therefore is used most commonly in conjunction with the
PRGRS_LOG_ABL -Dsrv switch. However, the PRGRS_LOG_ABL
switch can be enabled to acquire module and line number information with any log entry type
that writes SQL request information to the log.The ABL to SQL correlation is logged in the dataserv.lg file where the log
entries will contain the ABL module and the line number where the ABL procedure started. It
will also contain information about the SQL query executed on the foreign data source and the
visual delimiters.
The following ABL constructs log SQL query information:
|
|
Using PRGRS_LOG_ABL switch to log ABL to SQL correlation
This example shows how the ABL to SQL correlation is logged in the dataserv.lg file, when the FOR EACH statement is compiled.
|
The log output shown below, includes the ABL module name and the line number where the ABL procedure started in correlation to the SQL queries executed on the foreign data source. Visual delimiters are also logged for clarity in the log files.
|
PRGRS_LOG_ABL switch,
see Troubleshoot ABL Applications.