ADOdb Logging

This feature contains a breaking change from V5

Overview

The goal of the Logging Plugin is to provide an alternative updated logging mechanism for the core ADOdb feature, that replaces the functionality of the Debug Mode feature of ADOdb. Its features include:

Concept Of Use

The new system works using an inverse method to the existing Debug Mode flow:

This means that if a CRITICAL error handler is activated, then errors within ADOdb can be trapped and forwarded to a logging stream without any additional debugging information being logged. If required and configured, successful SQL Statement logging can include a debug backtrace

Sample Output

Plain Text Format

This includes an optional additional set of custom JSON tags

[2023-12-30T12:06:33.954984-07:00] ADODB.CRITICAL: Execution of statement failed: SELECT COUNT(*) FROM employee , / Error: 1146 Table 'employees.employee' doesn't exist [] {“system-type”:“production”}

JSON format

[2023-12-30T20:26:18.567813-07:00] ADODB.CRITICAL: {“version”:“1.0”,“ADOdbVersion”:“5.23.0-dev”,“level”:“500”,“shortMessage”:“QUERY EXECUTION FAILURE”,“sqlStatement”:{“sql”:“SELECT COUNT(*) FROM employee”,“params”:false},“errorCode”:1146,“errorMessage”:“Table 'employees.employee' doesn't exist”,“metaErrorCode”:-18,“metaErrorMessage”:“no such table”,“extendedData”:“”,“host”:“study”,“source”:“cli”,“driver”:“mysqli”,“php”:“8.0.29”,“os”:“WINNT”} [] {“git”:{“branch”:“master”,“commit”:“ce74ea93742080211c1b7c126c80b44eb9be1277”}}

This example incudes information from the Monolog Git Processor

Prerequisites