Unverified Commit 0357742c authored by rysiekpl's avatar rysiekpl Committed by GitHub
Browse files

Merge pull request #4 from czesiekhaker/master

Add support for request_slowlog_timeout
parents e574e5e8 e10afffa
......@@ -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/php7.0-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.
......
......@@ -104,22 +104,23 @@ if [[ "$PHP_APP_NAME" == "" || "$PHP_APP_USER" == "" || "$PHP_APP_GROUP" == "" |
fi
# info
echo "\$PHP_APP_NAME :: $PHP_APP_NAME"
echo "\$PHP_APP_USER :: $PHP_APP_USER"
echo "\$PHP_APP_GROUP :: $PHP_APP_GROUP"
echo "\$PHP_APP_DIR :: $PHP_APP_DIR"
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_PID_FILE :: $PHP_PID_FILE"
echo "\$PHP_APP_NAME :: $PHP_APP_NAME"
echo "\$PHP_APP_USER :: $PHP_APP_USER"
echo "\$PHP_APP_GROUP :: $PHP_APP_GROUP"
echo "\$PHP_APP_DIR :: $PHP_APP_DIR"
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?
if [[ "$PHP_APP_UID" != "" ]]; then
echo "\$PHP_APP_UID :: $PHP_APP_UID"
echo "\$PHP_APP_UID :: $PHP_APP_UID"
fi
if [[ "$PHP_APP_GID" != "" ]]; then
echo "\$PHP_APP_GID :: $PHP_APP_GID"
echo "\$PHP_APP_GID :: $PHP_APP_GID"
fi
......@@ -227,6 +228,8 @@ else
sed -i -r -e "s@^access\.log = .*@access.log = \"$PHP_ACCESS_LOG\"@g" /etc/php/7.0/fpm/pool.d/$PHP_APP_NAME.conf
echo "+-- slowlog..."
sed -i -r -e "s@^slowlog = .*@slowlog = \"$PHP_SLOW_LOG\"@g" /etc/php/7.0/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/php/7.0/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