0

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.

1
  • 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. Commented Jul 20, 2016 at 0:11

1 Answer 1

0

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.