Skip to content

Commit

Permalink
[Debug] Updated the default log level when a PHP error occurs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lyrixx committed Apr 2, 2015
1 parent 0942f0c commit d2f85ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Symfony/Component/Debug/ErrorHandler.php
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
Expand Up @@ -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),
Expand Down

0 comments on commit d2f85ed

Please sign in to comment.