@@ -541,6 +541,17 @@ alternative there, as well as adapting the above script to use your alternative
541
541
serialization.
542
542
543
543
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
+
544
555
.. _context-info :
545
556
546
557
Adding contextual information to your logging output
@@ -982,6 +993,17 @@ to this (remembering to first import :mod:`concurrent.futures`)::
982
993
for i in range(10):
983
994
executor.submit(worker_process, queue, worker_configurer)
984
995
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
+
985
1007
986
1008
Using file rotation
987
1009
-------------------
0 commit comments