Add logging to php error log

[MAILPOET-4104]
This commit is contained in:
Jan Lysý
2023-01-03 12:47:01 +01:00
committed by Aschepikov
parent b3691a4625
commit ada346f4ef

View File

@ -280,6 +280,9 @@ class API {
} }
private function logError(Throwable $e): void { private function logError(Throwable $e): void {
// logging to the php log
error_log((string)$e); // phpcs:ignore Squiz.PHP.DiscouragedFunctions
// logging to the MailPoet table
$this->loggerFactory->getLogger(LoggerFactory::TOPIC_API)->error($e->getMessage(), [ $this->loggerFactory->getLogger(LoggerFactory::TOPIC_API)->error($e->getMessage(), [
'requestMethod' => $this->requestMethod, 'requestMethod' => $this->requestMethod,
'requestData' => $this->requestData, 'requestData' => $this->requestData,