Tuesday, April 28, 2015

php fpm - nginx / php-fpm error logging

I'm trying to figure out where the PHP errors are going in my setup. I'm running nginx as the reverse proxy to PHP-FPM, but I'm not seeing the various E_NOTICE or E_WARNING messages my app is producing. The only reason I know they're happening is failed responses and NewRelic catching stack traces.



Here's the logging config:



nginx.conf



proxy_intercept_errors on;
fastcgi_intercept_errors on;



php.ini



error_reporting  =  E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off

report_memleaks = On
track_errors = On
error_log = syslog


php-fpm.conf



[global]
error_log = /var/log/php-fpm/fpm-error.log


[www]
access.log = /var/log/php-fpm/access.log
access.format = "%t \"%m %r%Q%q\" %s %{mili}dms %{kilo}Mkb %C%%"
catch_workers_output = yes

php_flag[display_errors] = on
php_admin_flag[log_errors] = true


rsyslog.conf




:syslogtag, contains, "php" /var/log/php-fpm/error.log


I've configured PHP to log to syslog, however FPM has no syslog function so it's logging to a file. I don't really care where the errors end up, just that they end up somewhere.



Any clues on how I might get this to work?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...