Exception Not Logged With Object (ARCH7159)
Esta página aún no está disponible en tu idioma.
Key php.logging.exception-not-logged · Severity warning · Category logging
Logging only a text message inside a catch drops the exception object and stack trace, losing context that is critical for diagnosis.
Incorrect
Section titled “Incorrect”<?phptry { $this->mailer->send($message);} catch (TransportException $e) { $this->logger->error('Email send failed');}Correct
Section titled “Correct”<?phptry { $this->mailer->send($message);} catch (TransportException $e) { $this->logger->error('Email send failed', ['exception' => $e]);}Add the exception object to the log context under the exception key.