From 4a5a150d92f14d1688d51257fb3ceb15a5f4a18c Mon Sep 17 00:00:00 2001 From: Patrick Forget Date: Thu, 10 Apr 2014 13:29:11 -0400 Subject: [PATCH 1/2] When handling exception log exception message rather generic message --- src/Monolog/ErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Monolog/ErrorHandler.php b/src/Monolog/ErrorHandler.php index d870767e..66d9d12b 100644 --- a/src/Monolog/ErrorHandler.php +++ b/src/Monolog/ErrorHandler.php @@ -123,7 +123,7 @@ class ErrorHandler { $this->logger->log( $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel, - 'Uncaught exception', + $e->getMessage(), array('exception' => $e) ); From 694fbb59232f14cffa45d895e4c45c04c91001e1 Mon Sep 17 00:00:00 2001 From: Patrick Forget Date: Fri, 11 Apr 2014 18:30:07 -0400 Subject: [PATCH 2/2] updated message to include even more useful information This was suggested by @kostiklv on github --- src/Monolog/ErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Monolog/ErrorHandler.php b/src/Monolog/ErrorHandler.php index 66d9d12b..f9cca004 100644 --- a/src/Monolog/ErrorHandler.php +++ b/src/Monolog/ErrorHandler.php @@ -123,7 +123,7 @@ class ErrorHandler { $this->logger->log( $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel, - $e->getMessage(), + sprintf('Uncaught Exception %s: "%s" at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()), array('exception' => $e) );