I’m thinking through all the points in my PHP application where it performs some sort of system process like database queries, or sending out an email, and I’m wondering if at all these points I should be notifying a user when something goes wrong. There are so many points where an application can fall apart, that I’m having trouble determining if it is worth it to notify the user. Is it better to have some sort of logging in place, where every few days I just monitor the logs? Is there a standard approach for large-scale applications?
Share
You could probably use something like log4php, which is a php-based implementation of the famous log4j library. You would then log messages whereever applicable using a ‘severity’. Based on two factors – severity and category you configure ‘where’ and ‘how’ to log/process/display the messages thanks to the flexible appender system.
While i’m not sure if there is already a complete solution for php, you could for instance have non-severe errors logged to a database and diplayed by admininstration component within your application, while severe errors get sent to you by e-mail and im.