1.error_log($message,$message_type,$destination,$extra_headers)函数,
2.message_type 是0,发送信息到PHP.ini配置的error_log的位置
cli环境下是这里:/etc/PHP/7.0/cli/PHP.ini
fpm环境下是:/etc/PHP/7.0/fpm/pool.d/www.conf PHP_admin_value[error_log] = /var/log/PHP_errors.log 注意这个文件的权限和PHP-fpm用户的运行
4.message_type 是1:
error_log("xxxx!",1,"630892807@qq.com");//直接发送到邮箱,需要配置postfix和PHP.ini的sendmail
直接包安装postfix和配置cli和fpm下的sendmail部分
3.message_type 是3就发送到第三个参数指定的文件中
4.message_type 是4直接发送到 SAPI 的日志处理程序中,比如返回给了Nginx,可以在Nginx配置的error_log里看到。