Respect logger_class setting unless statsd is on

This commit is contained in:
Alexis Le-Quoc 2014-08-15 23:31:16 -04:00
parent 42ff88bbbd
commit cc40f2e31f
2 changed files with 4 additions and 4 deletions

View File

@ -161,7 +161,7 @@ The `Statsd` logger overrides `gunicorn.glogging.Logger` to track
all requests. The following metrics are generated:
* ``gunicorn.requests``: request rate per second
* ``gunicorn.request.duration``: histogram of request duration
* ``gunicorn.request.duration``: histogram of request duration (in millisecond)
* ``gunicorn.workers``: number of workers managed by the arbiter (gauge)
* ``gunicorn.log.critical``: rate of critical log messages
* ``gunicorn.log.error``: rate of error log messages

View File

@ -142,9 +142,9 @@ class Config(object):
if uri == "simple":
# support the default
uri = "gunicorn.glogging.Logger"
# if statsd is on, automagically switch to the statsd logger
if 'statsd_host' in self.settings:
if 'statsd_host' in self.settings and self.settings['statsd_host'].value is not None:
logger_class = util.load_class("gunicorn.instrument.statsd.Statsd",
section="gunicorn.loggers")
else:
@ -1646,7 +1646,7 @@ class StatsdHost(Setting):
section = "Logging"
cli = ["--statsd-host"]
meta = "STATSD_ADDR"
default = "localhost:8125"
default = None
validator = validate_hostport
desc ="""\
host:port of the statsd server to log to