Allow Gunicorn logs in the container to be directed to a file specified through GUNICORN_ACCESS_LOGFILE. Fixes #4944

This commit is contained in:
Dave Page 2019-12-02 20:14:01 -05:00
parent ae2aadeede
commit 246a475600
3 changed files with 10 additions and 2 deletions

View File

@ -76,6 +76,13 @@ than using the default.
Override the default file path for the server definition list. See the Override the default file path for the server definition list. See the
/pgadmin4/servers.json mapped file below for more information. /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** **GUNICORN_THREADS**
*Default: 25* *Default: 25*

View File

@ -12,6 +12,7 @@ New features
| `Issue #4396 <https://redmine.postgresql.org/issues/4396>`_ - Warn the user on changing the definition of Materialized View about the loss of data and its dependent objects. | `Issue #4396 <https://redmine.postgresql.org/issues/4396>`_ - Warn the user on changing the definition of Materialized View about the loss of data and its dependent objects.
| `Issue #4435 <https://redmine.postgresql.org/issues/4435>`_ - Allow drag and drop functionality for all the nodes under the database node, excluding collection nodes. | `Issue #4435 <https://redmine.postgresql.org/issues/4435>`_ - Allow drag and drop functionality for all the nodes under the database node, excluding collection nodes.
| `Issue #4773 <https://redmine.postgresql.org/issues/4773>`_ - Added role="status" attribute to all the status messages for accessibility. | `Issue #4773 <https://redmine.postgresql.org/issues/4773>`_ - Added role="status" attribute to all the status messages for accessibility.
| `Issue #4944 <https://redmine.postgresql.org/issues/4944>`_ - Allow Gunicorn logs in the container to be directed to a file specified through GUNICORN_ACCESS_LOGFILE.
Housekeeping Housekeeping
************ ************

View File

@ -51,7 +51,7 @@ TIMEOUT=$(cd /pgadmin4 && python -c 'import config; print(config.SESSION_EXPIRAT
# Using --threads to have multi-threaded single-process worker # Using --threads to have multi-threaded single-process worker
if [ ! -z ${PGADMIN_ENABLE_TLS} ]; then 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 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 fi