From 3d338ea5737b7c113b17120b40684e2694cf3fa9 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 22 Aug 2011 02:16:55 -0400 Subject: - Use [app:main] instead of a pipeline in all scaffolds and tutorials and narrative docs. - Break out awkward description of PasteDeploy entry points from project chapter into its own Paste chapter. --- docs/narr/logging.rst | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'docs/narr/logging.rst') diff --git a/docs/narr/logging.rst b/docs/narr/logging.rst index 375ab820c..8abcba3c7 100644 --- a/docs/narr/logging.rst +++ b/docs/narr/logging.rst @@ -301,22 +301,36 @@ requests using the `Apache Combined Log Format with a FileHandler can be used to create an ``access.log`` file similar to Apache's. -Like any standard middleware with a Paste entry point, TransLogger can be -configured to wrap your application in the ``[app:main]`` section of the ini -file: +Like any standard middleware with a Paste entry point, TransLogger can be +configured to wrap your application using ``.ini`` file syntax. First, +rename your Pyramid ``.ini`` file's ``[app:main]`` section to +``[app:mypyramidapp]``, then add a ``[filter:translogger]`` section, then use +a ``[pipeline:main]`` section file to form a WSGI pipeline with both the +translogger and your application in it. For instance, change from this: .. code-block:: ini + [app:main] + use = egg:MyProject + +To this: + +.. code-block:: ini + + [app:mypyramidapp] + use = egg:MyProject + [filter:translogger] paste.filter_app_factory = egg:Paste#translogger setup_console_handler = False [pipeline:main] pipeline = translogger - myapp + mypyramidapp -This is equivalent to wrapping your app in a TransLogger instance via the -bottom the ``main`` function of your project's ``__init__`` file: +Using PasteDeploy this way to form and serve a pipeline is equivalent to +wrapping your app in a TransLogger instance via the bottom the ``main`` +function of your project's ``__init__`` file: .. code-block:: python -- cgit v1.2.3