I’d like to use CI profiler as a tool to audit an app. However, obviously in this case, I do not want the output to be displayed on the page, but rather be logged to the db.
I was thinking I could hook into profiler grab the relevant details (query, uri_string, etc.) and send that to a table in the db.
I could extend the profiler class to send data to the db, but this doesn’t eliminate the output to the screen. I’d like to be able to use the profiler normally as well from time to time, so re-writing the output class isn’t desirable.
Any ideas appreciated.
What I ended up doing was creating a library and copylasagna Profiler.php into it to modify as needed.
Try this. Add MY_Profiler.php to your libraries/ directory (I assume you’re in the 2.0+ branch; if not, lemme know):
EDIT: And to automatically enable the profiler for each controller (add to core/MY_Controller.php):