İçeriğe geç

İstisna Nesnesi Loglanmadı (ARCH7159)

Anahtar php.logging.exception-not-logged · Önem warning · Kategori logging

Bir catch içinde yalnızca metin mesajı loglamak, istisna nesnesini ve yığın izini düşürür; teşhis için kritik bağlamı kaybedersiniz.

<?php
try {
$this->mailer->send($message);
} catch (TransportException $e) {
$this->logger->error('Email send failed');
}
<?php
try {
$this->mailer->send($message);
} catch (TransportException $e) {
$this->logger->error('Email send failed', ['exception' => $e]);
}

İstisna nesnesini log context’ine exception anahtarıyla ekleyin.