[英]PHP-FPM log errors in database
I'd like to log all errors encountered on the server to MySQL rather than error_log file. 我想将服务器上遇到的所有错误记录到MySQL而不是error_log文件中。 There is a similar question already.
已经有一个类似的问题 。 However, the answer suggests to integrate a custom error handler .
但是,答案建议集成自定义错误处理程序 。
To be specific, I am looking for an option that could be integrated server wide (that doesn't mean prepending a file to every PHP file using php.ini settings), most likely C++ module. 具体来说,我正在寻找一个可能在服务器范围内集成的选项(这并不意味着要使用php.ini设置在每个PHP文件前添加一个文件),最有可能是C ++模块。
If you're running Linux, here is a solution for you: 如果您使用的是Linux,则可以使用以下解决方案:
error_log = syslog
in php.ini) error_log = syslog
) rsyslog
if not already installed (it's default on Debian I think, I don't know about the other distribs) rsyslog
如果尚未安装(它的Debian的默认,我认为,我不知道其他发行商) rsyslog
to write the logs to MySQL (see http://www.rsyslog.com/doc/rsyslog_mysql.html ) rsyslog
以将日志写入MySQL(请参阅http://www.rsyslog.com/doc/rsyslog_mysql.html )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.