diff --git a/src/Monolog/Formatter/NormalizerFormatter.php b/src/Monolog/Formatter/NormalizerFormatter.php index 95b3de36..dd7e433a 100644 --- a/src/Monolog/Formatter/NormalizerFormatter.php +++ b/src/Monolog/Formatter/NormalizerFormatter.php @@ -100,6 +100,7 @@ class NormalizerFormatter implements FormatterInterface $data = array( 'class' => get_class($e), 'message' => $e->getMessage(), + 'code' => $e->getCode(), 'file' => $e->getFile().':'.$e->getLine(), ); diff --git a/tests/Monolog/Formatter/NormalizerFormatterTest.php b/tests/Monolog/Formatter/NormalizerFormatterTest.php index 74778712..d4087c2f 100644 --- a/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ b/tests/Monolog/Formatter/NormalizerFormatterTest.php @@ -66,7 +66,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase 'exception' => array( 'class' => get_class($e2), 'message' => $e2->getMessage(), - 'file' => $e2->getFile().':'.$e2->getLine(), + 'code' => $e2->getCode(), + 'file' => $e2->getFile().':'.$e2->getLine(), ) ), $formatted); } diff --git a/tests/Monolog/Formatter/ScalarFormatterTest.php b/tests/Monolog/Formatter/ScalarFormatterTest.php index b8cbb132..9fbfadd1 100644 --- a/tests/Monolog/Formatter/ScalarFormatterTest.php +++ b/tests/Monolog/Formatter/ScalarFormatterTest.php @@ -55,6 +55,7 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase 'ban' => $this->encodeJson(array( 'class' => get_class($exception), 'message' => $exception->getMessage(), + 'code' => $exception->getCode(), 'file' => $exception->getFile() . ':' . $exception->getLine(), 'trace' => $this->buildTrace($exception) )) @@ -87,6 +88,7 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase 'exception' => array( 'class' => get_class($exception), 'message' => $exception->getMessage(), + 'code' => $exception->getCode(), 'file' => $exception->getFile() . ':' . $exception->getLine(), 'trace' => $this->buildTrace($exception) )