fluent-logger-php
fluent-logger-php copied to clipboard
Losing logs + lots of lines in stderr (error.log nginx)
Hi, We have a problem with the fluentd-logger-php class. Sometimes it goes in error (we haven't realize yet why, but we think it could be a socket connection error) and it writes in stderr a blob of things:
- It writes what we are trying to send to fluentd (application logs)
- Plus, it writes the php errors collected during the script, like notices for example (and our error level configured in php.ini file excludes the notices, so it is strange). Writing in stderr causes us a lot of noise in the nginx error.log, and, furthermore, we loose the application logs forever. The fluentd, even if is in debug mode, doesn't write anything when this problem happens. We experimentally caused a socket connection error modifying the library code (in development environment) and we got the problematic behaviour (wrote lines in error.log nginx). This is why we believe that this could be the problem.
Now, we want to understand some things:
- we would like to know precisely why this is happening and how we can detect the exact problem.
- we cannot have these lines of logs wrote in stderr, because in this way we cannot navigate the nginx logs to analyze them easily.
- we would like to not loose the log, but have something to retry the writing if something goes wrong, is this possible?
Thanks, Gioia
I forget to attach an error example: 2017/10/03 03:46:55 [error] 25083#25083: *38965696 FastCGI sent in stderr: "PHP message: Fluent\Logger\FluentLogger Undefined index: css log: {"a very long application log in json format"}