From d2f85ed5f7fbab3d89a6ac9d4dc3e3aa7b6cf187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Thu, 2 Apr 2015 16:50:50 +0200 Subject: [PATCH] [Debug] Updated the default log level when a PHP error occurs According to https://github.com/Seldaek/monolog#log-levels the level `NOTICE` means "Normal but significant events". So when a PHP notice occurs, it's not a "normal" event, but an error. That's why all PHP errors should use at lease the `WARNING` error level. --- src/Symfony/Component/Debug/ErrorHandler.php | 6 +++--- src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php index 43929b3a53df..d65dc1fdd9a7 100644 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ b/src/Symfony/Component/Debug/ErrorHandler.php @@ -71,9 +71,9 @@ class ErrorHandler private $loggers = array( E_DEPRECATED => array(null, LogLevel::INFO), E_USER_DEPRECATED => array(null, LogLevel::INFO), - E_NOTICE => array(null, LogLevel::NOTICE), - E_USER_NOTICE => array(null, LogLevel::NOTICE), - E_STRICT => array(null, LogLevel::NOTICE), + E_NOTICE => array(null, LogLevel::WARNING), + E_USER_NOTICE => array(null, LogLevel::WARNING), + E_STRICT => array(null, LogLevel::WARNING), E_WARNING => array(null, LogLevel::WARNING), E_USER_WARNING => array(null, LogLevel::WARNING), E_COMPILE_WARNING => array(null, LogLevel::WARNING), diff --git a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php index fafbdc7322ea..a37ffc79667c 100644 --- a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php +++ b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php @@ -141,9 +141,9 @@ public function testDefaultLogger() $loggers = array( E_DEPRECATED => array(null, LogLevel::INFO), E_USER_DEPRECATED => array(null, LogLevel::INFO), - E_NOTICE => array($logger, LogLevel::NOTICE), + E_NOTICE => array($logger, LogLevel::WARNING), E_USER_NOTICE => array($logger, LogLevel::CRITICAL), - E_STRICT => array(null, LogLevel::NOTICE), + E_STRICT => array(null, LogLevel::WARNING), E_WARNING => array(null, LogLevel::WARNING), E_USER_WARNING => array(null, LogLevel::WARNING), E_COMPILE_WARNING => array(null, LogLevel::WARNING),