diff --git a/gunicorn/config.py b/gunicorn/config.py index c6dbdbfe..656448c7 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -144,7 +144,7 @@ class Config(object): uri = "gunicorn.glogging.Logger" # if statsd is on, automagically switch to the statsd logger - if 'statsd_to' in self.settings: + if 'statsd_host' in self.settings: logger_class = util.load_class("gunicorn.instrument.statsd.Statsd", section="gunicorn.loggers") else: @@ -1641,10 +1641,10 @@ if sys.version_info >= (2, 7): """ # statsD monitoring -class StatsdTo(Setting): - name = "statsd_to" +class StatsdHost(Setting): + name = "statsd_host" section = "Logging" - cli = ["--statsd-to"] + cli = ["--statsd-host"] meta = "STATSD_ADDR" default = "localhost:8125" validator = validate_hostport diff --git a/gunicorn/instrument/statsd.py b/gunicorn/instrument/statsd.py index daae4026..e712c47f 100644 --- a/gunicorn/instrument/statsd.py +++ b/gunicorn/instrument/statsd.py @@ -25,7 +25,7 @@ class Statsd(Logger): """ Logger.__init__(self, cfg) try: - host, port = cfg.statsd_to + host, port = cfg.statsd_host self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.sock.connect((host, int(port))) except Exception: