標籤:style blog color for 檔案 2014 div sp 代碼
預設是以原生安裝路徑
cd /usr/local/php/etc/
vim php-fpm.conf
; The log file for slow requests; Default Value: not set; Note: slowlog is mandatory if request_slowlog_timeout is setslowlog = log/pool.log.slow //可以修改慢日誌的路徑; The timeout for serving a single request after which a PHP backtrace will be; dumped to the ‘slowlog‘ file. A value of ‘0s‘ means ‘off‘.; Available units: s(econds)(default), m(inutes), h(ours), or d(ays); Default Value: 0request_slowlog_timeout = 1 //慢日誌逾時的時間
不過目錄需要手動建立,不然重啟php-fpm將會出錯
mkdir /usr/local/php/log
php-fpm慢日誌的例子,慢日誌會記錄下進程號,指令碼名稱,具體哪個檔案哪行代碼的哪個函數執行時間過長。
查看慢記錄檔 tail -10f pool.log.show
[19-Sep-2014 11:34:12] [pool www] pid 2957script_filename = /data/wwwroot/cms.91.com/webroot/mobile91.php[0x00000000030c6c10] request_by_curl() /data/wwwroot/cms.91.com/webroot/mobile91.php:207[0x00000000030c6190] request_by_curl() /data/wwwroot/cms.91.com/webroot/mobile91.php:189[19-Sep-2014 11:34:47] [pool www] pid 2968script_filename = /data/wwwroot/cms.91.com/webroot/mobile91.php[0x000000000300b840] request_by_curl() /data/wwwroot/cms.91.com/webroot/mobile91.php:206[0x000000000300adc0] request_by_curl() /data/wwwroot/cms.91.com/webroot/mobile91.php:189
php開啟慢日誌