From 246a475600477c0bdd09a8ef19135a6a17501ab4 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Mon, 2 Dec 2019 20:14:01 -0500 Subject: [PATCH] Allow Gunicorn logs in the container to be directed to a file specified through GUNICORN_ACCESS_LOGFILE. Fixes #4944 --- docs/en_US/container_deployment.rst | 7 +++++++ docs/en_US/release_notes_4_16.rst | 1 + pkg/docker/entrypoint.sh | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/en_US/container_deployment.rst b/docs/en_US/container_deployment.rst index cafacb45a..3eb506157 100644 --- a/docs/en_US/container_deployment.rst +++ b/docs/en_US/container_deployment.rst @@ -76,6 +76,13 @@ than using the default. Override the default file path for the server definition list. See the /pgadmin4/servers.json mapped file below for more information. +**GUNICORN_ACCESS_LOGFILE** + +*Default: -* (stdout) + +Specify an output file in which to store the Gunicorn access logs, instead of +sending them to stdout. + **GUNICORN_THREADS** *Default: 25* diff --git a/docs/en_US/release_notes_4_16.rst b/docs/en_US/release_notes_4_16.rst index e77d9bacf..6acb55fbe 100644 --- a/docs/en_US/release_notes_4_16.rst +++ b/docs/en_US/release_notes_4_16.rst @@ -12,6 +12,7 @@ New features | `Issue #4396 `_ - Warn the user on changing the definition of Materialized View about the loss of data and its dependent objects. | `Issue #4435 `_ - Allow drag and drop functionality for all the nodes under the database node, excluding collection nodes. | `Issue #4773 `_ - Added role="status" attribute to all the status messages for accessibility. +| `Issue #4944 `_ - Allow Gunicorn logs in the container to be directed to a file specified through GUNICORN_ACCESS_LOGFILE. Housekeeping ************ diff --git a/pkg/docker/entrypoint.sh b/pkg/docker/entrypoint.sh index af02fd6d3..070aa5579 100755 --- a/pkg/docker/entrypoint.sh +++ b/pkg/docker/entrypoint.sh @@ -51,7 +51,7 @@ TIMEOUT=$(cd /pgadmin4 && python -c 'import config; print(config.SESSION_EXPIRAT # Using --threads to have multi-threaded single-process worker if [ ! -z ${PGADMIN_ENABLE_TLS} ]; then - exec gunicorn --timeout ${TIMEOUT} --bind ${PGADMIN_LISTEN_ADDRESS:-[::]}:${PGADMIN_LISTEN_PORT:-443} -w 1 --threads ${GUNICORN_THREADS:-25} --access-logfile - --keyfile /certs/server.key --certfile /certs/server.cert run_pgadmin:app + exec gunicorn --timeout ${TIMEOUT} --bind ${PGADMIN_LISTEN_ADDRESS:-[::]}:${PGADMIN_LISTEN_PORT:-443} -w 1 --threads ${GUNICORN_THREADS:-25} --access-logfile ${GUNICORN_ACCESS_LOGFILE:--} --keyfile /certs/server.key --certfile /certs/server.cert run_pgadmin:app else - exec gunicorn --timeout ${TIMEOUT} --bind ${PGADMIN_LISTEN_ADDRESS:-[::]}:${PGADMIN_LISTEN_PORT:-80} -w 1 --threads ${GUNICORN_THREADS:-25} --access-logfile - run_pgadmin:app + exec gunicorn --timeout ${TIMEOUT} --bind ${PGADMIN_LISTEN_ADDRESS:-[::]}:${PGADMIN_LISTEN_PORT:-80} -w 1 --threads ${GUNICORN_THREADS:-25} --access-logfile ${GUNICORN_ACCESS_LOGFILE:--} run_pgadmin:app fi