I’m trying to customize the logging functionality of codeigniter. I found this forum thread which describes exactly what I need:
http://codeigniter.com/forums/viewthread/139997/
But I want to do that without altering core files/classes.
I”m trying to alter the log_message function. I’ve already extended the CI_Log class and that is working well, but now I’m trying to alter log_message() which resides in system/core/Common.php. It isn’t actually a class so I can’t extend it, it just appears to be a collection of useful functions. I tried redeclaring log_message() and placing it in application/core/Common.php, but that doesn’t appear to work. Any ideas how I can go about this?
I believe that the function you actually want to alter is
write_log(), correct me if I’m wrong. You can do this by extending the function withinapplication\libraries\MY_Log.php.I have the following script in my MY_Log.php which emails me any time an error is thrown:
If you’re not looking to extend the write function, you will need to extend one of the other log functions.