1.error_log($message,$message_type,$destination,$extra_headers)函數,php
2.message_type 是0,發送信息到php.ini配置的error_log的位置
cli環境下是這裏:/etc/php/7.0/cli/php.ini nginx
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
php-fpm
直接包安裝postfix和配置cli和fpm下的sendmail部分post
3.message_type 是3就發送到第三個參數指定的文件中
日誌
4.message_type 是4直接發送到 SAPI 的日誌處理程序中,好比返回給了nginx,能夠在nginx配置的error_log裏看到。blog