Yii2 not catching fatal errors when error_reporting is set
<p>When setting Yii2 to production mode in index.php - </p>

<pre><code>defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod')
</code></pre>

<p>I have a logger, which correctly logs errors while in production mode, and prints out an appropriate error message on user page, but also show these error messages on notices (killing pages unnecessarily).
So, I set error_reporting in index.php - </p>

<pre><code>error_reporting(E_ALL &amp; ~E_NOTICE &amp; ~E_STRICT);
</code></pre>

<p>But this prevents Yii2 from catching errors at all, so that they don't get logged, and renders a blank page in the event of any error allowed by error_reporting. It prevents notices from killing the page, but logging quits working when I use error_reporting()</p>

<p>Is there a Yii2 appropriate way of doing this? Has anyone had this issue before? Thanks for all attempted solutions.</p>

<p>The error log configuration - </p>

<pre><code>    $log['targets'][] = [
    'class' =&gt; 'understeam\slack\LogTarget',
    'exportInterval' =&gt; 1,
    'levels' =&gt; ['error', 'warning'],
    'except' =&gt; [
        'yii\i18n*',
        'yii\web\HttpException:404',
        'yii\web\HttpException:403',
        'yii\web\ForbiddenHttpException',
        'yii\web\NotAcceptableHttpException',
        'yii\base\InvalidRouteException'
    ],
];
</code></pre>

<p>The above is using the vendor package "understeam/yii2-slack": "~0.3"</p>