I'm trying to extend the CodeIgniter log library with a bit of additional information that I load from the "Session" library. This appears to be possible according to the information here: http://codeigniter.com/user_guide/general/creating_libraries.html
So, I created a file in application/libraries called MY_Log.php with the following:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Log extends CI_Log {
function __construct() {
parent::__construct();
$CI =& get_instance();
$CI->load->library('session');
}
}
?>
The trouble is, whenever I call get_instance from within this file, I get a "500 Internal Server Error". I tried swapping out my codeigniter system directory with a fresh copy of the latest version (2.1.2), but I get the same error. What am I doing wrong?
Thanks in advance.