4

I'm trying to setup an php-fpm daemon to send error_log to syslog.

My config php-fpm.conf looks thereby.

error_log = syslog
syslog.facility = local4
syslog.ident = php-fpm

Restarting php-fpm daemon I can see in the remote syslog server.

Mar 22 00:32:08 192.168.33.14 php-fpm[20919]: [NOTICE] configuration file /etc/php5/fpm/php-fpm.conf test is successful

Good!

But when I test this with a real php script with errors, message change to..

Mar 22 00:05:59 192.168.33.14 ool www[20889]: PHP Parse error:  syntax error, unexpected ''api'' (T_CONSTANT_ENCAPSED_STRING) in /var/api/public/index.php on line 2

ool www is pool + default pool name (www). So two questions:

  • Why I see ool www instead of php-fpm (syslog.ident value)?
  • Why is pool title is truncated?
2
  • Although my own trick (stackoverflow.com/questions/22569001/…) fixed the issue, no solves the question. Commented Mar 24, 2014 at 9:22
  • Were you able to resolve this? Commented Oct 2, 2015 at 16:16

2 Answers 2

2

I think its a PHP bug :( See please

https://bugs.php.net/bug.php?id=67764

Sign up to request clarification or add additional context in comments.

Comments

2

This issue will become more prevalent as we start to upgrade older systems to php 5.5+, so posting for future reference.

Here is the fix we used, put it as low level as you can so all your scripts can benefit:

// This was needed for upgrade to php5.5+ with php-fpm
//  Source: https://gist.github.com/gjuric/e0c9e45efb3d15e3b949
//  Bug History: http://stackoverflow.com/questions/22575152/sending-errors-to-syslog-in-php-fpm
openlog('php', LOG_ODELAY, LOG_USER);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.