make new table in yuor database named "tbl_logger" with 5 fields:
CREATE TABLE IF NOT EXISTS `tbl_logger` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`level` varchar(128) NOT NULL,
`category` varchar(128) NOT NULL,
`logtime` int(11) NOT NULL,
`message` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
STEP 3:
In yuor code write where u want:
Yii::log($user . ' whit this IP:'. $ip .'blablabla...', 'info', 'level');
@Paskuale, I’ve tried with your suggest but it does not works, sigh.
if (1==1)
{
Yii::log('Errore durante il salvataggio del reset', CLogger::LEVEL_INFO);
throw new CHttpException(500, 'Si è verificato un errore, riprova.');
}
This return error 500, but the log table is empty…