I was looking for a possibility to log all CI errors into ordinary PHP log file (domain related in my case). But there was no such, i could just enable CI error logger, but that was not what i wanted, because of log analyzing and cleanup tasks. I wanted definitely get them as PHP errors.
So, that small piece of code do the magic. Create it as
MY_Log.php under
application/core/
PHP Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Log extends CI_Log {
public function write_log($level, $msg) {
if($level == 'error') {
error_log($msg);
}
return parent::write_log($level, $msg);
}
}
So, that's it. It will log all errors as PHP errors in your PHP log file. Hope you like it!