Skip to content

[php-fpm][error_log] the log always has prefix "NOTICE: PHP message:" #1626

@mocxi

Description

@mocxi

Hello,

I'm using docker image php:8.4-fpm with fpm pool setting as below:

access.log = /proc/self/fd/1
catch_workers_output = yes
decorate_workers_output = no
php_flag[display_errors] = off
php_admin_value[error_log] = /proc/self/fd/2
php_admin_flag[log_errors] = off

when I tri to print error_log in php:

error_log('test');

I see that php-fpm process added prefix to the log:

NOTICE: PHP message: test

(Note: Setting decorate_workers_output = no successfully removes timestamps/FPM headers from stdout/stderr, but does not affect the specific prefix added by error_log() redirected to /proc/self/fd/2)

Is there a specific PHP-FPM pool configuration directive, or perhaps a different approach (other than switching to file_put_contents('php://stderr', ...)), that can completely suppress the NOTICE: PHP message: prefix when error_log() output is redirected to /proc/self/fd/2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions