@@ -1414,7 +1414,7 @@ is non-zero, we can overwrite that value in the header.
14141414 Why do I see no error tracebacks in my ASGI application?
14151415--------------------------------------------------------
14161416
1417- When using Falcon with an ASGI server like Uvicorn ,
1417+ When using Falcon with an ASGI server,
14181418you might notice that server errors do not include any traceback by default.
14191419This behavior differs from WSGI, where the PEP-3333 specification defines the
14201420`wsgi.errors <https://peps.python.org/pep-3333/#environ-variables >`__ stream
@@ -1424,8 +1424,17 @@ This behavior differs from WSGI, where the PEP-3333 specification defines the
14241424Since there is no standardized way to log errors back to the ASGI server,
14251425the framework simply opts to log them using the ``falcon ``
14261426:class: `logger <logging.Logger> `.
1427+ As a well-behaved library, Falcon does not preconfigure any loggers since that
1428+ might interfere with the user's logging setup.
14271429
1428- The easiest way to get started is configuring the root logger via
1430+ Starting with Falcon :doc: `4.3 </changes/4.3.0 >`, however, the framework no
1431+ longer adds an instance of :class: `logging.NullHandler ` to the ``falcon ``
1432+ logger, so error tracebacks may still reach ``sys.stderr `` via the
1433+ :any: `logging.lastResort ` handler (but it depends on the existing logging
1434+ configuration of the ASGI server in question).
1435+
1436+ If you are seeing an HTTP 500 error response without any corresponding
1437+ traceback, the easiest way to get started is configuring the root logger via
14291438:func: `logging.basicConfig `:
14301439
14311440.. code :: python
@@ -1451,4 +1460,4 @@ By adding the above logging configuration, you should now see tracebacks logged
14511460to :any: `stderr <sys.stderr> ` when accessing ``/things ``.
14521461
14531462For additional details on this topic,
1454- please refer to :ref: `debugging_asgi_applications `.
1463+ please refer to the ASGI tutorial: :ref: `debugging_asgi_applications `.
0 commit comments