Print full error message in poller/discovery output (#13903)

It was previously missing the file and line number the error occurred on.  Only showing the error message and stack trace before.
This commit is contained in:
Tony Murray
2022-04-09 14:21:10 -05:00
committed by GitHub
parent 5672d10a79
commit acdf51deca
3 changed files with 3 additions and 3 deletions

View File

@@ -329,7 +329,7 @@ function poll_device($device, $force_module = false)
include "includes/polling/$module.inc.php";
} catch (Throwable $e) {
// isolate module exceptions so they don't disrupt the polling process
Log::error("%rError polling $module module for {$device['hostname']}.%n " . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), ['color' => true]);
Log::error("%rError polling $module module for {$device['hostname']}.%n $e", ['color' => true]);
Log::event("Error polling $module module. Check log file for more details.", $device['device_id'], 'poller', Alert::ERROR);
}