mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
+1
-1
@@ -180,7 +180,7 @@ class Poller
|
||||
$instance->poll($this->os);
|
||||
} catch (Throwable $e) {
|
||||
// isolate module exceptions so they don't disrupt the polling process
|
||||
$this->logger->error("%rError polling $module module for {$this->device->hostname}.%n " . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), ['color' => true]);
|
||||
$this->logger->error("%rError polling $module module for {$this->device->hostname}.%n $e", ['color' => true]);
|
||||
\Log::event("Error polling $module module. Check log file for more details.", $this->device, 'poller', Alert::ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ function discover_device(&$device, $force_module = false)
|
||||
include "includes/discovery/$module.inc.php";
|
||||
} catch (Throwable $e) {
|
||||
// isolate module exceptions so they don't disrupt the polling process
|
||||
Log::error("%rError discovering $module module for {$device['hostname']}.%n " . $e->getMessage() . PHP_EOL . $e->getTraceAsString(), ['color' => true]);
|
||||
Log::error("%rError discovering $module module for {$device['hostname']}.%n $e", ['color' => true]);
|
||||
Log::event("Error discovering $module module. Check log file for more details.", $device['device_id'], 'discovery', Alert::ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user