Allow configuring logger_class with statsd_host

Currently if you configure statsd_host, a configured logger_class will never be used.

I think this makes a user configured logger class always take priority.

(This is PoC change, I will come back and add tests/docs if it's worth pursuing)
This commit is contained in:
Simon Davy 2016-01-22 14:21:01 +00:00 committed by bloodearnest
parent b776eba5fe
commit f68a043c24

View File

@ -147,7 +147,7 @@ class Config(object):
uri = "gunicorn.glogging.Logger"
# if statsd is on, automagically switch to the statsd logger
if 'statsd_host' in self.settings and self.settings['statsd_host'].value is not None:
if uri is not None and '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: