Gunicorn: disable health check logging in access logging

Created on 16 May 2018  ·  3Comments  ·  Source: benoitc/gunicorn

we got tons of these in our access log at high frequency (eg. health checks, metric scrapes by prometheus):

"GET /healthz HTTP/1.1" 200 2 "-" "kube-probe/1.8"

which generally is fine, but very verbose. Can we somehow ignore a path from access logging?

Question Discussion FeaturLogging help wanted FeaturConfig

All 3 comments

no action since. closing the issue. Also I don't think we should do anything about incoming requests.

It'd be great to be able to configure gunicorn to not log healthcheck requests if the result is 200. These definitely crowd my logs too.

I don't think it makes sense to add this kind of feature. Gunicorn uses Python logging. You can definitely implement a log filter of some kind at the Python level or lower. You could filter the output steam, or filter the log lines as they are forwarded to an aggregator system. I just can't see a way it feels right to implement features in the core of Gunicorn for this.

Was this page helpful?
0 / 5 - 0 ratings