Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
fix(gunicorn): silence healthcheck points in access logs
Browse files Browse the repository at this point in the history
If DEIS_DEBUG is set then they show up again
  • Loading branch information
helgi committed May 30, 2016
1 parent 6ac4d18 commit a43f1d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rootfs/deis/gconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import faulthandler
faulthandler.enable()


bind = '0.0.0.0'
try:
workers = int(os.environ.get('GUNICORN_WORKERS', 'not set'))
Expand All @@ -13,8 +14,11 @@
workers = multiprocessing.cpu_count() * 2 + 1
except NotImplementedError:
workers = 8

pythonpath = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
timeout = 1200
pidfile = '/tmp/gunicorn.pid'
logger_class = 'deis.logging.Logging'
loglevel = 'info'
errorlog = '-'
accesslog = '-'
Expand Down
14 changes: 14 additions & 0 deletions rootfs/deis/logging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os
from gunicorn.glogging import Logger


class Logging(Logger):
def access(self, resp, req, environ, request_time):
# health check endpoints are only logged in debug mode
if (
not os.environ.get('DEIS_DEBUG', False) and
req.path in ['/readiness', '/healthz']
):
return

Logger.access(self, resp, req, environ, request_time)

0 comments on commit a43f1d6

Please sign in to comment.