mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Change --statsd-to to --statsd-host
This commit is contained in:
parent
964c06a25e
commit
3c9b9e3218
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user