Database query logger - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: Database query logger (/showthread.php?tid=174) |
Database query logger - kimse - 11-07-2014 Support for logging of queries Something like this: https://github.com/rebizu/CodeIgniter/compare/bcit-ci:develop...develop RE: Database query logger - kilishan - 11-07-2014 The queries are already stored by the database system in $db->queries. You could always create a MY_Model that overrode the common methods and handled logging for you after each query. Probably easiest done using the $db->last_query() method. RE: Database query logger - kimse - 11-07-2014 (11-07-2014, 12:15 PM)kilishan Wrote: The queries are already stored by the database system in $db->queries. You could always create a MY_Model that overrode the common methods and handled logging for you after each query. Probably easiest done using the $db->last_query() method. Debugging is an essential part of developing, adding that kind of code each time, to debug the SQL queries feels ridiculous to me. RE: Database query logger - kilishan - 11-07-2014 I wasn't saying it wouldn't happen in the future, just trying to provide a way that you can do that now. And if you create a thorough MY_Model with the logging built in you don't have to do it every time. The biggest issue I could see with it as a default is the extra performance hit, but it's always something to consider. |