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

error(string $message): void

Scroll Prev Top Next More

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

Parameter

Type

Description

$message

string

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

Example:

try {

    // source code that throws a JobRouterException 

} catch (JobRouterException $e) {

    $this->error($e->getMessage());

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

}