Skip to content

Commit eb47caf

Browse files
committed
Merge pull request #757 from helgi/silence_gunicorn
fix(gunicorn): silence healthcheck points in access logs
2 parents 6ac4d18 + a43f1d6 commit eb47caf

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

rootfs/deis/gconf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import faulthandler
33
faulthandler.enable()
44

5+
56
bind = '0.0.0.0'
67
try:
78
workers = int(os.environ.get('GUNICORN_WORKERS', 'not set'))
@@ -13,8 +14,11 @@
1314
workers = multiprocessing.cpu_count() * 2 + 1
1415
except NotImplementedError:
1516
workers = 8
17+
18+
pythonpath = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
1619
timeout = 1200
1720
pidfile = '/tmp/gunicorn.pid'
21+
logger_class = 'deis.logging.Logging'
1822
loglevel = 'info'
1923
errorlog = '-'
2024
accesslog = '-'

rootfs/deis/logging.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
from gunicorn.glogging import Logger
3+
4+
5+
class Logging(Logger):
6+
def access(self, resp, req, environ, request_time):
7+
# health check endpoints are only logged in debug mode
8+
if (
9+
not os.environ.get('DEIS_DEBUG', False) and
10+
req.path in ['/readiness', '/healthz']
11+
):
12+
return
13+
14+
Logger.access(self, resp, req, environ, request_time)

0 commit comments

Comments
 (0)