From f68a043c2456931fed155a542a852a5a9f7a65ae Mon Sep 17 00:00:00 2001 From: Simon Davy Date: Fri, 22 Jan 2016 14:21:01 +0000 Subject: [PATCH] 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) --- gunicorn/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index 3b028e7f..ff0a9a84 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -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: