Skip to content

Commit 8b015d7

Browse files
author
Ric Harvey
authored
Merge pull request richarvey#189 from marek-knappe/issue-184-php-error-to-stderr
Added option to send logs to docker logs Issue richarvey#184
2 parents f2f35a2 + 6a2df65 commit 8b015d7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

docs/config_flags.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The following flags are a list of all the currently supported options that can b
2424
| PHP_MEM_LIMIT | Set higher PHP memory limit, default is 128 Mb |
2525
| PHP_POST_MAX_SIZE | Set a larger post_max_size, default is 100 Mb |
2626
| PHP_UPLOAD_MAX_FILESIZE | Set a larger upload_max_filesize, default is 100 Mb |
27+
| PHP_ERRORS_STDERR | Send php logs to docker logs |
2728
| DOMAIN | Set domain name for Lets Encrypt scripts |
2829
| REAL_IP_HEADER | set to 1 to enable real ip support in the logs |
2930
| REAL_IP_FROM | set to your CIDR block for real ip in logs |

scripts/start.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ if [ -f /etc/nginx/sites-available/default-ssl.conf ]; then
117117
fi
118118
fi
119119

120+
#Display errors in docker logs
121+
if [ ! -z "$PHP_ERRORS_STDERR" ]; then
122+
echo "log_errors = On" >> /usr/local/etc/php/conf.d/docker-vars.ini
123+
echo "error_log = /dev/stderr" >> /usr/local/etc/php/conf.d/docker-vars.ini
124+
fi
125+
120126
# Increase the memory_limit
121127
if [ ! -z "$PHP_MEM_LIMIT" ]; then
122128
sed -i "s/memory_limit = 128M/memory_limit = ${PHP_MEM_LIMIT}M/g" /usr/local/etc/php/conf.d/docker-vars.ini

0 commit comments

Comments
 (0)