Collect three kinds of logs here
PHP error log, php-fpm error log and slow query log
Set in php.ini
Error_log =/data/app_data/php/logs/php_errors.log
Set in php-fpm.conf
Error_log =/data/app_data/php/logs/php-fpm_error.log
Slowlog =/data/app_data/php/logs/php-fpm_slow.log
The PHP error log is as follows:
[29-jan-2015 07:37:44 utc] php warning: php startup: unable to load dynamic library '/data/app_platform/php/lib/php/extensions/no-debug-non-zts-20100525 /redis.so ' - /data/app_platform/php/lib/php/extensions/no-debug-non-zts-20100525/redis.so: Cannot open shared object file: no such file or directory in Unknown on line 0[29-Jan-2015 07:37:44 UTC] PHP Warning: php startup: unable to load dynamic library '/data/app_platform/php/lib/php /extensions/no-debug-non-zts-20100525/apc.so ' - /data/app_platform/php/lib/php/extensions/ No-debug-non-zts-20100525/apc.so: cannot open shared object file: no such file or directory in unknown on line 0[29-jan-2015 07:37:44 utc] php warning: php startup: unable to load dynamic library '/data/app_platform/ Php/lib/php/extensions/no-debug-non-zts-20100525/mongo.so ' - /data/app_platform/php/lib/php/ extensions/no-debug-non-zts-20100525/mongo.so: cannot open shared object file: No such file or directory in unknown on line 0
The PHP-FPM error log is as follows:
[30-jan-2015 10:32:25] error: unable to read what child say: bad file descriptor (9) [30-jan-2015 10:32:25] error: unable to read what child say: bad file descriptor (9) [30-jan-2015 10:32:25] error: unable to read what child say: Bad file descriptor (9) [30- Jan-2015 10:32:25] error: unable to read what child say: bad file descriptor (9) [30-jan-2015 10:32:25] error: unable to read what child say: bad file descriptor (9) [10-mar-2015 17:37:11] error: unable to read what child say: Bad file descriptor (9) [10- Mar-2015 17:37:11] error: unable to read what child say: bad file descriptor (9) [10-mar-2015 21:31:48] error: unable to read what child say: Bad file descriptor (9)
The slow query log for PHP-FPM is as follows:
[11-mar-2015 16:54:17] [pool www] pid 12873script_filename = /data// Index.php[0x00007f497fa5b620] curl_exec () /data//account.php:221[0x00007f497fa5a4e0] call () /data/gintama_app/jidong/game_code/app/controllers/game.php:31[0x00007fff29eea180] load () Unknown:0[0x00007f497fa59e18] call_user_func_array () /data/library/basectrl.php:20[ 0x00007fff29eea470] handoutaction () unknown:0[0x00007f497fa59400] run () /data//index.php : 30[11-mar-2015 16:56:46] [pool www] pid 12881script_filename = /data /index.php[0x00007f497fa5b620] curl_exec () /data//account.php:221[0x00007f497fa5a4e0] call () /data/game.php:31[0x00007fff29eea180] load () unknown:0[0x00007f497fa59e18] call_user_func _array () /data/library/basectrl.php:20[0x00007fff29eea470] handoutaction () unknown:0[ 0x00007f497fa59400] run () /data/index.php: 30
This article is from the Linux SA John blog, so be sure to keep this source http://john88wang.blog.51cto.com/2165294/1641723
Collect PHP-related logs using Logstash