| ▲ | wesammikhail 5 hours ago | ||||||||||||||||
The way I have solved for this in my own framework in PHP is by having a Logging class with the following interface
I also have a global exception handler that is registered at application bootstrap time that takes any exception that happens at runtime and runs $logger->exception($e);There is obviously a tiny bit more of boilerplating to this to ensure reliability, but it works so well that I can't live without it anymore. The logs are then inserted into a wide DB table with all the field one could ever want to examine thanks to the variadic parameter. | |||||||||||||||||
| ▲ | hu3 4 hours ago | parent [-] | ||||||||||||||||
Nice. I guess you write logs on the "final" block of a global try/catch/final? Something like: | |||||||||||||||||
| |||||||||||||||||