CodeIgniter Forums
Logging - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Logging (/showthread.php?tid=15225)



Logging - El Forum - 01-29-2009

[eluser]JayArias[/eluser]
How would I create a feature to log , everything done by my users to a database?


Logging - El Forum - 01-29-2009

[eluser]davidbehler[/eluser]
You could write a small library and whenever the user does something that you want to log, you call a method of that library and tell it to insert a new entry into the database.

Look here for infos on how to create your own libraries.


Logging - El Forum - 01-29-2009

[eluser]moodh[/eluser]
I made a model and autoloaded it, then used add('msg', type, flag etc) everywhere i want to log stuff.
I don't feel it's a library since it's pretty much write/read to a database.


Logging - El Forum - 01-29-2009

[eluser]davidbehler[/eluser]
Yeah, you are right...a model is propably enough