I'm trying to writes PHP error to a mysql database. If there’s a way we can change it so that instead of writing directly to an error_log file, it sends the error to a script, which records it in the db.
-
What about rsyslog or syslog-ng ? Send your mysql logs to a syslog server, then setup a filter on it that will intercept php errors and throttle your own script to update your db with the error message. This is the way i would do it.– krisFRJul 20, 2016 at 0:11
1 Answer
How about using a framework for logging. Log4PHP would also improve your logging over all. It has a MySQL appender. https://logging.apache.org/log4php/docs/appenders/pdo.html