Commit 74705228 authored by Michał 'czesiek' Czyżewski's avatar Michał 'czesiek' Czyżewski
Browse files

Add support for request_slowlog_timeout

parent 753f2b8e
......@@ -36,6 +36,7 @@ ENV PHP_APP_NAME="www" \
PHP_ACCESS_LOG="/dev/null" \
PHP_ERROR_LOG="/dev/null" \
PHP_SLOW_LOG="/dev/null" \
PHP_SLOW_LOG_TIMEOUT="5s" \
PHP_PID_FILE="/var/run/php5-fpm.pid"
# we might need to install some packages, but doing this in the entrypoint doesn't make any sense
......
......@@ -100,6 +100,10 @@ This packages *will be installed each time the docker container is recreated*, s
Access, [error](http://php.net/manual/en/errorfunc.configuration.php#ini.error-log), and slowlog locations, accordingly. By default all are set to `/dev/null`.
- `PHP_SLOW_LOG_TIMEOUT` (default: `"5s"`)
Timeout after which PHP will dump the backtrace to slowlog.
- `PHP_PID_FILE` (default: `"/var/run/php5-fpm.pid"`)
The `php-fpm` pidfile location.
......
......@@ -112,6 +112,7 @@ echo "\$PHP_LISTEN :: $PHP_LISTEN"
echo "\$PHP_ACCESS_LOG :: $PHP_ACCESS_LOG"
echo "\$PHP_ERROR_LOG :: $PHP_ERROR_LOG"
echo "\$PHP_SLOW_LOG :: $PHP_SLOW_LOG"
echo "\$PHP_SLOW_LOG_TIMEOUT :: $PHP_SLOW_LOG_TIMEOUT"
echo "\$PHP_PID_FILE :: $PHP_PID_FILE"
# do we have UID/GID number given explicitly?
......@@ -227,6 +228,8 @@ else
sed -i -r -e "s@^access\.log = .*@access.log = \"$PHP_ACCESS_LOG\"@g" /etc/php5/fpm/pool.d/$PHP_APP_NAME.conf
echo "+-- slowlog..."
sed -i -r -e "s@^slowlog = .*@slowlog = \"$PHP_SLOW_LOG\"@g" /etc/php5/fpm/pool.d/$PHP_APP_NAME.conf
echo "+-- slowlog timeout..."
sed -i -r -e "s@^request_slowlog_timeout = .*@request_slowlog_timeout = \"$PHP_SLOW_LOG_TIMEOUT\"@g" /etc/php5/fpm/pool.d/$PHP_APP_NAME.conf
fi
# Change the default error location.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment