Add PSR-3 compliant exception context when logging exceptions (#300)
* Add PSR-3 exception context to caught error logs * Apply review feedback
This commit is contained in:
parent
bfc4728792
commit
73414d65f6
1 changed files with 88 additions and 27 deletions
|
|
@ -96,7 +96,7 @@ try {
|
|||
$logger->info('Disconnected');
|
||||
exit(0);
|
||||
} catch (Throwable $e) {
|
||||
$logger->error(sprintf('Error: %s', $e->getMessage()));
|
||||
$logger->error(sprintf('Error: %s', $e->getMessage()), ['exception' => $e]);
|
||||
fwrite(\STDERR, sprintf("Error: %s\n%s\n", $e->getMessage(), $e->getTraceAsString()));
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue