Collect PHP-related logs using Logstash

Source: Internet
Author: User
Tags apc php error php error log zts logstash
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_platfor M/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- 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 "Say:bad file descriptor (9) [30-jan-2015 10:32:25] error:unable to read" child say: Bad file descriptor (9) [30-jan-2015 10:32:25] error:unable to read "Child Say:bad file Descriptor (9) [30-jan-2015 10 : 32:25] error:unable to read "Say:bad file descriptor (9) [30-jan-2015 10:32:25] error:unable to read what Chi LD Say:bad file Descriptor (9) [10-mar-2015 17:37:11] error:unable to read about child Say:bad file descriptor (9) [10-mar -2015 17:37:11] error:unable to read "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
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.