Skip to content

Logging

Stephen Vickers edited this page May 21, 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 three 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 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_INFO;

The following methods include logging events:

  • ToolProvider->handleRequest:
    • details of the request received (LOGLEVEL_INFO)
    • reason for any error with the request (LOGLEVEL_ERROR)
  • 'Http\HttpMessage->send' (LOGLEVEL_INFO when successful, LOGLEVEL_ERROR when unsuccessful):
    • details of the request being sent (URL and and POST parameters or message body)
    • the response received (headers and any message body)

Clone this wiki locally