I am creating a management/crm system.
I have a class in my libs folder called Util which contains some static functions.
I want to create a static function for logging user actions from anywhere in my system i.e.
Util::log($userId, $action) ;
The bit that has me wondering is how should I pass this data to my database as I would need to instantiate my database class which is contained in a class called Model in my libs folder.
What is the smoothest way to do this?
Would it be better to simply create a log class in my controllers folder and have it interface with its own logModel class the same way as all my other non lib controllers do?