diff --git a/cake/libs/error/error_handler.php b/cake/libs/error/error_handler.php index 85cea7ec4..b25582fac 100644 --- a/cake/libs/error/error_handler.php +++ b/cake/libs/error/error_handler.php @@ -110,7 +110,12 @@ class ErrorHandler { if (!class_exists('CakeLog')) { require LIBS . 'cake_log.php'; } - CakeLog::write(LOG_ERR, '[' . get_class($exception) . '] ' . $exception->getMessage()); + $message = sprintf("[%s] %s\n%s", + get_class($exception), + $exception->getMessage(), + $exception->getTraceAsString() + ); + CakeLog::write(LOG_ERR, $message); } if ($config['renderer'] !== 'ExceptionRenderer') { App::import('Lib', $config['renderer']); diff --git a/cake/tests/cases/libs/error/error_handler.test.php b/cake/tests/cases/libs/error/error_handler.test.php index 736524251..c6f33d600 100644 --- a/cake/tests/cases/libs/error/error_handler.test.php +++ b/cake/tests/cases/libs/error/error_handler.test.php @@ -220,6 +220,7 @@ class ErrorHandlerTest extends CakeTestCase { $log = file(LOGS . 'error.log'); $this->assertPattern('/\[NotFoundException\] Kaboom!/', $log[0], 'message missing.'); + $this->assertPattern('/\#0.*ErrorHandlerTest->testHandleExceptionLog/', $log[1], 'Stack trace missing.'); } }