dhtmlxconnector:errors [DHX documentation]

PHP Connector DHTMLX

Errors handling and logging

While developing we strongly recommend to use logs for errors detection.

server-side logging

DHTMLX permits logging to be controlled in two ways:

basic

If any error occurs during data processing, client-side data processor object will receive “error” action containing short info about the problem (full info will be written to the log).

$conn->enable_log("path");
  • path - absolute or relative path to text file where log will be written.

detailed

When critical error occurs all log records for current session (full error info) will be sent to client and shown in browser (useful for debugging, not recommended for production):

$conn->enable_log("path",true);
  • path - absolute or relative path to text file where log will be written.
  • The second parameter enables detailed mode.

adding custom records to the log

During development you may need to write some custom data to the log (can be useful for custom server-side events).
To add custom text or data to log file:

  • Activate logging (basic or detailed).
  • Call log() function with your data inside.
$conn->enable_log("temp.log");
LogMaster::log("any text here");

client-side logging

Dataprocessor has its own client-side logger, which can be enabled by including one additional js file - dhtmlxdataprocessor_debug.js