Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Gunicorn logging documentation #2921

Merged
merged 4 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/2921.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve Gunicorn logging documentation
2 changes: 2 additions & 0 deletions docs/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ In this case, we will use:
many worker processes to use for handling requests. (See the
documentation for recommendations on `How Many Workers?
<http://docs.gunicorn.org/en/latest/design.html#how-many-workers>`_)
* you may also want to use the *'--accesslog'* flag to enable the access
log to be populated. (See :ref:`logging <gunicorn-accesslog>` for more information.)

The custom worker subclass is defined in ``aiohttp.GunicornWebWorker``::

Expand Down
27 changes: 21 additions & 6 deletions docs/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,26 @@ Example of drop-in replacement for :class:`aiohttp.helpers.AccessLogger`::
f'"{request.method} {request.path} '
f'done in {time}s: {response.status}')

.. note::

When `Gunicorn <http://docs.gunicorn.org/en/latest/index.html>`_ is used for
:ref:`deployment <aiohttp-deployment-gunicorn>` its default access log format
will be automatically replaced with the default aiohttp's access log format.
.. _gunicorn-accesslog:

Gunicorn access logs
^^^^^^^^^^^^^^^^^^^^
When `Gunicorn <http://docs.gunicorn.org/en/latest/index.html>`_ is used for
:ref:`deployment <aiohttp-deployment-gunicorn>` its default access log format
will be automatically replaced with the default aiohttp's access log format.

If Gunicorn's option access_logformat_ is
specified explicitly it should use aiohttp's format specification.

Gunicorn access log works only if accesslog_ is specified explicitly in your
config or as a command line option.
This configuration can be either a path or ``'-'``. If the application uses
a custom logging setup intercepting the ``'gunicorn.access'`` logger,
accesslog_ should be set to ``'-'`` to prevent Gunicorn to create an empty
access log file upon every startup.


If Gunicorn's option access_logformat_ is
specified explicitly it should use aiohttp's format specification.


Error logs
Expand All @@ -127,3 +139,6 @@ To use different logger name please specify *logger* parameter

.. _access_logformat:
http://docs.gunicorn.org/en/stable/settings.html#access-log-format

.. _accesslog:
http://docs.gunicorn.org/en/stable/settings.html#accesslog