mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-10 19:11:16 +00:00
Fix docker logs for PHP mail func logging
This commit is contained in:
@@ -21,6 +21,9 @@ CONFIG_DIR="/docker-entrypoint.d"
|
||||
# php.ini.d directory
|
||||
PHP_INI_DIR="/usr/local/etc/php/conf.d"
|
||||
|
||||
# This is the log file for any mail related functions
|
||||
PHP_MAIL_LOG="/var/log/mail.log"
|
||||
|
||||
# This file holds error and access log definitions
|
||||
FPM_CONF_LOGFILE="/usr/local/etc/php-fpm.d/logfiles.conf"
|
||||
|
||||
@@ -69,12 +72,6 @@ set_gid "NEW_GID" "${MY_GROUP}" "/home/${MY_USER}" "${DEBUG_LEVEL}"
|
||||
set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
|
||||
|
||||
|
||||
###
|
||||
### Setup postfix
|
||||
###
|
||||
set_postfix "ENABLE_MAIL" "${MY_USER}" "${MY_GROUP}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
|
||||
|
||||
|
||||
###
|
||||
### Set Logging
|
||||
###
|
||||
@@ -87,6 +84,18 @@ set_docker_logs \
|
||||
"${DEBUG_LEVEL}"
|
||||
|
||||
|
||||
###
|
||||
### Setup postfix
|
||||
###
|
||||
if is_docker_logs_enabled "DOCKER_LOGS" >/dev/null; then
|
||||
# PHP mail function should log to stderr
|
||||
set_postfix "ENABLE_MAIL" "${MY_USER}" "${MY_GROUP}" "${PHP_INI_DIR}" "/proc/self/fd/2" "1" "${DEBUG_LEVEL}"
|
||||
else
|
||||
# PHP mail function should log to file
|
||||
set_postfix "ENABLE_MAIL" "${MY_USER}" "${MY_GROUP}" "${PHP_INI_DIR}" "${PHP_MAIL_LOG}" "0" "${DEBUG_LEVEL}"
|
||||
fi
|
||||
|
||||
|
||||
###
|
||||
### Validate socat port forwards
|
||||
###
|
||||
|
||||
Reference in New Issue
Block a user