Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: System activities > Description of the PHP API for system activities > API methods > Logging

log(string $message, string $level): void

Scroll Prev Top Next More

Adds a line to the log file depending on the set log level and can be used in a system activity.

Parameter

Type

Description

$message

string

Text of the log entry, which is written to the log file (/output/<activityId>.log) at the set log level

$level

string

Log level of the entry to be logged

 

Possible values for the severity can be found in the manual for PHP functions, chapter Error logging

Example:

try {

    $invoiceNo = 'DE-2020-186533584-001';

    // source code that throws a JobRouterException 

} catch (JobRouterException $e) {

    $this->log($invoiceNo,"DEBUG");

    $this->log($e->getMessage(),"ERROR");

    throw new JobRouterException('An error has occurred. For further details, please refer to the log file.');

}