Logging errors with CodeIgniter

Logging errors which occur within your CodeIgniter application doesn't have to be limited to looking at the PHP or Apache logs; you can enable CodeIgniter to handle and log errors and other behaviors and events at certain points in your code using CodeIgniter's logging functionality. This facility can be particularly useful (if you set it up correctly) to track a user's journey and progress through the system and should something go wrong with whatever they're doing, you can look in the logs and trace what they did and when, and get a better idea of what (if at all) went wrong and hopefully think about how to prevent it from occurring again.

In this recipe, we're going to look at using the logging functionality within ...

Get CodeIgniter 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.