ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:logging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
v5:reference:logging [2019/12/30 05:13] – created mnewnhamv5:reference:logging [2024/01/09 11:14] (current) – Remove duplicated information described under Debug Mode dregad
Line 1: Line 1:
 ====== Logging ====== ====== Logging ======
  
-===== Debugging ===== +ADOdb provides an internal debugging system that exposes the executed SQL commands, as well as other messages that can help when troubleshooting errors when, for example, trying to establish a connection to the database or an SQL statement fails.  
-^ Debug Level  ^ Description  ^ + 
-| true         | Default      | +The earliest that debugging can be started is after instantiating the driver but before connection.  
--1                        | + 
--99          |              | +===== Usage ===== 
-| 99                        |+ 
 +Please refer to [[v5:userguide:debug]] for details on usage. 
 + 
 + 
 +===== Overriding The Default Logging Function =====  
 +The default logging behavior is to send all messages to STDOUT, but the behavior may be modified by either: 
 +  - Defining a constant **ADODB_OUTP** which holds the name of the function that overrides the standard value 
 +  - A variable **$ADODB_OUTP** which is globalized and achieves the same as above. This function can be dynamically changed. 
 + 
 +=== Function Definition ==== 
 + 
 +The overriding function must accept 2 arguments: 
 +  A String which contains the message 
 +  A boolean which indicates whether to throw a newline. This may be discarded based on how the function works 
 + 
 +==== Example Function ==== 
 +<code php> 
 +DEFINE ('ADODB_OUTP','myLogger'); 
 + 
 +function myLogger($msg,$discard) 
 +
 +    print "\nThis is my messsage: $msg"; 
 + 
 +</code>
  
  
v5/reference/logging.1577679231.txt.gz · Last modified: 2019/12/30 05:13 by mnewnham