@@ -541,6 +541,17 @@ alternative there, as well as adapting the above script to use your alternative
541541serialization.
542542
543543
544+ Running a logging socket listener in production
545+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
546+
547+ To run a logging listener in production, you may need to use a process-management tool
548+ such as `Supervisor <http://supervisord.org/ >`_. `Here
549+ <https://gist.github.com/vsajip/4b227eeec43817465ca835ca66f75e2b> `_ is a Gist which
550+ provides the bare-bones files to run the above functionality using Supervisor: you
551+ will need to change the `/path/to/ ` parts in the Gist to reflect the actual paths you
552+ want to use.
553+
554+
544555.. _context-info :
545556
546557Adding contextual information to your logging output
@@ -982,6 +993,17 @@ to this (remembering to first import :mod:`concurrent.futures`)::
982993 for i in range(10):
983994 executor.submit(worker_process, queue, worker_configurer)
984995
996+ Deploying Web applications using Gunicorn and uWSGI
997+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
998+
999+ When deploying Web applications using `Gunicorn <https://gunicorn.org/ >`_ or `uWSGI
1000+ <https://uwsgi-docs.readthedocs.io/en/latest/> `_ (or similar), multiple worker
1001+ processes are created to handle client requests. In such environments, avoid creating
1002+ file-based handlers directly in your web application. Instead, use a
1003+ :class: `SocketHandler ` to log from the web application to a listener in a separate
1004+ process. This can be set up using a process management tool such as Supervisor - see
1005+ `Running a logging socket listener in production `_ for more details.
1006+
9851007
9861008Using file rotation
9871009-------------------
0 commit comments