Error reporting level phpAt times you don't see any messages in the log file or you see a blank page instead of output or you only see fatal or critical errors but not  information or notice messages etc and you may wonder why. This is because PHP has so many log level. What you see in the logs correspond to error reporting level set at global level in php.ini. This error reporting level can also be overwritten at runtime by in the script. The various error reporting levels are defined as constants and string enums as follows.

value constant
1 E_ERROR
2 E_WARNING
4 E_PARSE
8 E_NOTICE
16 E_CORE_ERROR
32 E_CORE_WARNING
64 E_COMPILE_ERROR
128 E_COMPILE_WARNING
256 E_USER_ERROR
512 E_USER_WARNING
1024 E_USER_NOTICE
6143 E_ALL
2048 E_STRICT
4096 E_RECOVERABLE_ERROR
8192 E_DEPRECATED
16384 E_USER_DEPRECATED
The following snippet shows how can various error reporting level can be set to get the desired output.
 

<?php

/**
*
* Examples of error reporting override
*/


// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);

?>
One of the interesting use-case could change the error level dynamically to report all errors lets say for a 
developer (development) and display no errors when its customer facing (production). This switch can be done
 based on IP address or some other criteria.

<?php

// Only display php errors to the developer

if($_SERVER['REMOTE_ADDR']=="127.0.0.1")
{
ini_set('display_errors','On');
}
else
{
ini_set('display_errors','Off');
}

// Just replace 127.0.0.1 with your ip address.
?>