Change --statsd-to to --statsd-host

This commit is contained in:
Alexis Le-Quoc 2014-06-18 21:50:50 -04:00
parent 964c06a25e
commit 3c9b9e3218
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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: