How to log only real php errors

Hi.

With standart config:


        'log' => [

            'traceLevel' => YII_DEBUG ? 3 : 0,

            'targets' => [

                [

                    'class' => 'yii\log\FileTarget',

                    'levels' => ['error', 'warning'],

                ],

            ],

        ],

it logs all the stuff including "page not found" and all other exceptions, like forbidden.

But i do not want this on prodaction.

I want to be informed only about php errors, warnings, notices (real problems with my code). How can I accomplish this?

In the Yii entry script, you need to commend the following lines




<?php


// comment out the following two lines when deployed to production

defined('YII_DEBUG') or define('YII_DEBUG', true);

defined('YII_ENV') or define('YII_ENV', 'dev');






so that it will be




<?php


// comment out the following two lines when deployed to production

//defined('YII_DEBUG') or define('YII_DEBUG', true);

//defined('YII_ENV') or define('YII_ENV', 'dev');






now you will not receive the trace levels of errors.

And based on the settings you have given in your php.ini configuration file, you can see the php errors.

Those lines are commented on prodaction, of course.

I am thinking about specifying category to ‘yii\base\ErrorException’ but have no confidence that it wont miss anything important.

I see that db errors are in the other category. Is there some full list of these categories?..

Now I have:


                    'categories' => [

                        'yii\db\*',

                        'yii\base\ErrorException:*'

                    ],  

What else might I need to be informed about problems with MY CODE ?