Child pages
  • Guide to the LiveAPI System - The debug_log() Method
Skip to end of metadata
Go to start of metadata

 

Description

The debug_log() method writes data to the debugging log file.

  • By default, LiveAPI environments log debugging data to the /home/user/.cpanel/LiveAPI.log.rand file, where user is the cPanel account's username, and rand is a random string that cPanel & WHM generates.

Example


LiveAPI PHP Class

// Log an error to the LiveAPI error log.
$cpanel->debug_log('1','This is an error message.','false');


LiveAPI Perl Module

# Log an error to the LiveAPI error log.
$cpliveapi->debug_log('1','This is an error message.','false');

Parameters

ParameterTypeDescriptionPossible valuesExample
levelinteger

The debug log level above which the system logs the message string.

For example, if this value is 2 and the debug_level value is 1, the system will log the message. If this value is 2 and the debug_level value is 3, the system will not log the message.

A positive integer.

Note:

If you set this value to 0, and set the stderr value to true, the message will only log to stderr

1
messagestringThe error message to log.A valid string.This is an error message.
stderrstringWhether to also write the error message to STDERR.
  • true or 1 — Also write the error to STDERR.
  • false or 0 — Only write the error to the error log.
false

Returns

This method returns a boolean value that indicates success or failure:

  • 1 — Success.
  • 0 — Failure.