Error > mail

Is there a way I can mail each error that I get in my application?

So I can track all the error in my site.

You need to configure CEmailLogRoute class.

Like this one:


array(

    …

    'preload'=>array('log'),

    'components'=>array(

        …

        'log'=>array(

            'class'=>'CLogRouter',

            'routes'=>array(

                array(

                    'class'=>'CFileLogRoute',

                    'levels'=>'trace, info',

                    'categories'=>'system.*',

                ),

                array(

                    'class'=>'CEmailLogRoute',

                    'levels'=>'error, warning',

                    'emails'=>'admin@example.com',

                ),

            ),

        ),

    ),

)

http://www.yiiframework.com/doc/api/CEmailLogRoute