The wordpress:php7.4-fpm-alpine image comes with following file. ref:
bash-5.0# cat /usr/local/etc/php/conf.d/error-logging.ini
error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR
display_errors = Off
display_startup_errors = Off
log_errors = On
error_log = /dev/stderr
log_errors_max_len = 1024
ignore_repeated_errors = On
ignore_repeated_source = Off
html_errors = Off
According to official PHP documentation:
message is sent to PHP's system logger, using the Operating System's system logging mechanism or a file, depending on what the error_log configuration directive is set to. This is the default option.
except that we haven't seen this work in practice. We changed the error_log to /var/www/html/wp-content/test.log but log messages are still written to /var/www/html/wp-content/debug.log which is the default location of WP_DEBUG_LOG. we thought maybe this is happening because the file does not exist so we created the file and even chown the permissions to make www-data the owner but still no luck. Has anyone experienced this?