-
Notifications
You must be signed in to change notification settings - Fork 40
Logging
Stephen Vickers edited this page Jun 26, 2020
·
6 revisions
The Util class includes a static property named logLevel which can be used to control the sending of log messages to the PHP error log. This property should be given one of four values defined as constants in the class:
| Constant name | Description |
|---|---|
| LOGLEVEL_NONE | No log messages are recorded (this is the default setting) |
| LOGLEVEL_ERROR | Only logs of errors are recorded |
| LOGLEVEL_INFO | All error and information log messages are recorded |
| LOGLEVEL_DEBUG | All log messages are recorded |
By default, no messages are logged. To change this include a line such as the following before any messages or service requests are processed:
use ceLTIc\LTI\Util;
...
Util::$logLevel = Util::LOGLEVEL_DEBUG;
The following methods include logging events:
-
Tool->handleRequest:- details of the request received (
LOGLEVEL_INFO) - reason for any error with the request (
LOGLEVEL_ERROR)
- details of the request received (
- 'Http\HttpMessage->send' (
LOGLEVEL_INFOwhen successful,LOGLEVEL_ERRORwhen unsuccessful):- details of the request being sent (URL and and POST parameters or message body)
- the response received (headers and any message body)
-
DataConnector\DataConnectorsub-classes:- SQL statements executed (
LOGLEVEL_DEBUGwhen successful,LOGLEVEL_ERRORwhen unsuccessful)
- SQL statements executed (
Debug-level logging is also enabled when the debugMode property of the Tool or Platform object in use is set to true. When enabled, this setting will override the currently defined log level. See the Usage section for more information.
© 2025 Stephen P Vickers. All Rights Reserved.