Skip to content

Commit

Permalink
make LOGGING_DIR_GUNICRON a variable
Browse files Browse the repository at this point in the history
* this makes running foreman as non-root easier
  • Loading branch information
Rioting Pacifist committed Mar 7, 2022
1 parent 7a028ad commit 4837acb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions conf/gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import multiprocessing
# import multiprocessing
import os

bind = "unix:/tmp/mygpo.sock"
Expand All @@ -8,8 +8,9 @@
# The maximum number of requests a worker will process before restarting.
# max_requests = 1000

errorlog = "/var/log/gunicorn/error.log"
accesslog = "/var/log/gunicorn/access.log"
log_dir = os.getenv("LOGGING_DIR_GUNICRON", "/var/log/gunicorn/")
errorlog = log_dir + "error.log"
accesslog = log_dir + "access.log"
loglevel = "info"
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s %(T)s "%(f)s" "%(a)s"'

Expand All @@ -31,7 +32,7 @@ def _post_fork_handler(server, worker):


try:
# check f we *can* use gevent
# check if we *can* use gevent
from psycogreen.gevent import patch_psycopg
except ImportError:
_USE_GEVENT = False
Expand Down
2 changes: 2 additions & 0 deletions doc/dev/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ Logging
* ``LOGGING_DJANGO_HANDLERS`` - space separated list of logging handlers for Django log events
* ``LOGGING_MYGPO_HANDLERS`` - space separated list of logging handlers for mygpo log events
* ``LOGGING_FILENAME`` - filename for filesystem logs
* ``LOGGING_DIR_GUNICRON`` - directory for gunicron to log into
* ``OPBEAT_APP_ID`` - Opbeat App ID
* ``OPBEAT_ORGANIZATION_ID`` - Opbeat Organization ID
* ``OPBEAT_SECRET_TOKEN`` - Opbeat Secret Token



Social Login
------------

Expand Down

0 comments on commit 4837acb

Please sign in to comment.