Save PHP errors and Yii Exceptions in data base

How is possible to save all PHP notices, warnings, errors and Yii Exceptions in data base? I have to create system monitoring tool to catch immediately all YII exceptions and php errors what happens in YII webpage.

Config CDbLogRoute in your main components