From b423d0e38eef559b7e81acb7e32059de305f982c Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Fri, 31 Oct 2025 09:11:18 +0000 Subject: [PATCH] Improvements to the logging documentation --- docs/client.rst | 11 ++++++++--- docs/server.rst | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/client.rst b/docs/client.rst index e3e1fb2..64cbec8 100644 --- a/docs/client.rst +++ b/docs/client.rst @@ -198,9 +198,14 @@ terminal:: The ``logger`` argument controls logging related to the Socket.IO protocol, while ``engineio_logger`` controls logs that originate in the low-level -Engine.IO transport. These arguments can be set to ``True`` to output logs to -``stderr``, or to an object compatible with Python's ``logging`` package -where the logs should be emitted to. A value of ``False`` disables logging. +Engine.IO transport. The value given to these arguments controls logging +behavior: + +* ``True``: Enables log output to ``stderr`` at the ``INFO`` level. +* ``False``: Enables log output to ``stderr`` at the ``ERROR`` level. This is + the default. +* A ``logging.Logger`` instance: Uses the provided logger without additional + configuration. Logging can help identify the cause of connection problems, unexpected disconnections and other issues. diff --git a/docs/server.rst b/docs/server.rst index 1bc4c68..f31e668 100644 --- a/docs/server.rst +++ b/docs/server.rst @@ -657,9 +657,14 @@ terminal:: The ``logger`` argument controls logging related to the Socket.IO protocol, while ``engineio_logger`` controls logs that originate in the low-level -Engine.IO transport. These arguments can be set to ``True`` to output logs to -``stderr``, or to an object compatible with Python's ``logging`` package -where the logs should be emitted to. A value of ``False`` disables logging. +Engine.IO transport. The value given to these arguments controls logging +behavior: + +* ``True``: Enables log output to ``stderr`` at the ``INFO`` level. +* ``False``: Enables log output to ``stderr`` at the ``ERROR`` level. This is + the default. +* A ``logging.Logger`` instance: Uses the provided logger without additional + configuration. Logging can help identify the cause of connection problems, 400 responses, bad performance and other issues.