When writing quality applications, logging is one of the most important thing we need to look for. Just like every other framework Codeigniter has the logging facility and it works fine.
But the order of log levels defined in codeigniter is wrong. Here is the default log levels in codeigniter.
INFO level need to have more severity than DEBUG. And the order needs to be revised as follows
Most of the popular log frameworks follow above standard and here is the Log4j Wiki about it’s Log Level.
Someone might argue what is the problem here and argue that we treat it seperately. But the problem is not that.
I’ve worked on this and sent a pull request to Codeigniter Github repository and It is waiting for the approval.
Hope it will be added in the future versions of codeigniter
I simply can’t just wait for the core fix approve for this and I extend the CI Log library and fix this. Here is the steps how it can be fixed
application/libraries
folderMY_Log.php
( If you’ve changed Subclass Prefix to something else, use it instead MY_
)Okay, this is my thoughts on this and If you’ve found this is interesting please find my pull request and express your opinion.