Fix docker logs for PHP mail func logging

This commit is contained in:
cytopia
2018-03-05 18:40:34 +01:00
parent 389b962aaf
commit fe379ae977
4 changed files with 68 additions and 14 deletions

View File

@@ -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
###