I am debugging a case where an exception is thrown from a job. However the exception I am interested in is in the $previous field. The problem is that the stack trace written to $message does not contain that one. Thus I can not see what is going wrong!
But IMO it would be better if exception's could be logged to my own logging destination of choice. That could then fix the proper formatting for exceptions.
I am debugging a case where an exception is thrown from a job. However the exception I am interested in is in the
$previous
field. The problem is that the stack trace written to$message
does not contain that one. Thus I can not see what is going wrong!So a solution could be to improve upon the build-in logging. As is done for example in Monolog (https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/NormalizerFormatter.php#L133).
But IMO it would be better if exception's could be logged to my own logging destination of choice. That could then fix the proper formatting for exceptions.
There is now way to do this now as far as I can see. Code in the adapter libraries needs to be changed in order for this to work. See https://github.com/juriansluiman/SlmQueueDoctrine/blob/master/src/Worker/DoctrineWorker.php#L40-L46.
As that would require some work; is there an easier solution I am missing?