From 24bf2a83c5172e6974c997495e8f1c7922394617 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 16 Dec 2010 15:03:15 -0500 Subject: Features -------- - Added ``debug_routematch`` configuration setting that logs matched routes (including the matchdict and predicates). Documentation ------------- - Added "Debugging Route Matching" section to the urldispatch narrative documentation chapter. - Added reference to ``BFG_DEBUG_ROUTEMATCH`` envvar and ``debug_routematch`` config file setting to the Environment narrative docs chapter. --- docs/narr/urldispatch.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'docs/narr/urldispatch.rst') diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index c84a5ca06..f0ace76ba 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -1268,6 +1268,37 @@ not very ambitious. .. note:: See :ref:`security_chapter` for more information about :app:`Pyramid` security and ACLs. +.. _debug_routematch_section: + +Debugging Route Matching +------------------------ + +It's useful to be able to take a peek under the hood when requests that enter +your application arent matching your routes as you expect them to. To debug +route matching, use the ``BFG_DEBUG_ROUTEMATCH`` environment variable or the +``debug_routematch`` configuration file setting (set either to ``true``). +Details of the route matching decision for a particular request to the +:app:`Pyramid` application will be printed to the ``stderr`` of the console +which you started the application from. For example: + +.. code-block:: text + :linenos: + + [chrism@thinko pylonsbasic]$ BFG_DEBUG_ROUTEMATCH=true \ + bin/paster serve development.ini + Starting server in PID 13586. + serving on 0.0.0.0:6543 view at http://127.0.0.1:6543 + 2010-12-16 14:45:19,956 no route matched for url \ + http://localhost:6543/wontmatch + 2010-12-16 14:45:20,010 no route matched for url \ + http://localhost:6543/favicon.ico + 2010-12-16 14:41:52,084 route matched for url \ + http://localhost:6543/static/logo.png; \ + route_name: 'static/', .... + +See :ref:`environment_chapter` for more information about how, and where to +set these values. + References ---------- -- cgit v1.2.3