Skip to content

Commit

Permalink
Combine logging section in gunicorn/config.py.
Browse files Browse the repository at this point in the history
Fixes #969.
  • Loading branch information
berkerpeksag committed Jan 26, 2015
1 parent fa1b7cc commit d49d400
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 52 deletions.
45 changes: 21 additions & 24 deletions docs/source/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,27 @@ Enable inheritance for stdio file descriptors in daemon mode.
Note: To disable the python stdout buffering, you can to set the user
environment variable ``PYTHONUNBUFFERED`` .

statsd_host
~~~~~~~~~~~

* ``--statsd-host STATSD_ADDR``
* ``None``

``host:port`` of the statsd server to log to.

.. versionadded:: 19.1

statsd_prefix
~~~~~~~~~~~~~

* ``--statsd-prefix STATSD_PREFIX``
* ````

Prefix to use when emitting statsd metrics (a trailing ``.`` is added,
if not provided).

.. versionadded:: 19.2

Process Naming
--------------

Expand Down Expand Up @@ -947,27 +968,3 @@ ciphers

Ciphers to use (see stdlib ssl module's)

Logging
-------

statsd_host
~~~~~~~~~~~

* ``--statsd-host STATSD_ADDR``
* ``None``

``host:port`` of the statsd server to log to.

.. versionadded:: 19.1

statsd_prefix
~~~~~~~~~~~~~

* ``--statsd-prefix STATSD_PREFIX``
* ````

Prefix to use when emitting statsd metrics (a trailing ``.`` is added,
if not provided).

.. versionadded:: 19.2

57 changes: 29 additions & 28 deletions gunicorn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,35 @@ class EnableStdioInheritance(Setting):
"""


# statsD monitoring
class StatsdHost(Setting):
name = "statsd_host"
section = "Logging"
cli = ["--statsd-host"]
meta = "STATSD_ADDR"
default = None
validator = validate_hostport
desc = """\
``host:port`` of the statsd server to log to.
.. versionadded:: 19.1
"""

class StatsdPrefix(Setting):
name = "statsd_prefix"
section = "Logging"
cli = ["--statsd-prefix"]
meta = "STATSD_PREFIX"
default = ""
validator = validate_string
desc = """\
Prefix to use when emitting statsd metrics (a trailing ``.`` is added,
if not provided).
.. versionadded:: 19.2
"""


class Procname(Setting):
name = "proc_name"
section = "Process Naming"
Expand Down Expand Up @@ -1659,31 +1688,3 @@ class Ciphers(Setting):
desc = """\
Ciphers to use (see stdlib ssl module's)
"""

# statsD monitoring
class StatsdHost(Setting):
name = "statsd_host"
section = "Logging"
cli = ["--statsd-host"]
meta = "STATSD_ADDR"
default = None
validator = validate_hostport
desc = """\
``host:port`` of the statsd server to log to.
.. versionadded:: 19.1
"""

class StatsdPrefix(Setting):
name = "statsd_prefix"
section = "Logging"
cli = ["--statsd-prefix"]
meta = "STATSD_PREFIX"
default = ""
validator = validate_string
desc = """\
Prefix to use when emitting statsd metrics (a trailing ``.`` is added,
if not provided).
.. versionadded:: 19.2
"""

0 comments on commit d49d400

Please sign in to comment.