From b52d4af82b7ca88b2e1b547a3042629d58217a96 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 18 Feb 2015 15:54:02 +0100 Subject: [PATCH 1/5] Added a note about log file sizes and the use of logrotate --- cookbook/logging/monolog.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cookbook/logging/monolog.rst b/cookbook/logging/monolog.rst index e50c520159d..78ad77e38b2 100644 --- a/cookbook/logging/monolog.rst +++ b/cookbook/logging/monolog.rst @@ -229,8 +229,14 @@ Monolog allows you to process the record before logging it to add some extra data. A processor can be applied for the whole handler stack or only for a specific handler. -A processor is simply a callable receiving the record as its first argument. +.. tip:: + Beware that log file sizes can grow very rapidly, leading to disk space exhaustion. + This is specially true in the ``dev`` environment, where a simple request can + generate hundreds of log lines. Consider using tools like the ``logrotate`` + Linux command to contain log files before they become a problem. + +A processor is simply a callable receiving the record as its first argument. Processors are configured using the ``monolog.processor`` DIC tag. See the :ref:`reference about it `. From e7ac0c6beac83bf58c55606c063bdd8d89a3da9f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 18 Feb 2015 16:27:32 +0100 Subject: [PATCH 2/5] Removed an unmerged change --- cookbook/logging/monolog.rst | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cookbook/logging/monolog.rst b/cookbook/logging/monolog.rst index 78ad77e38b2..e50c520159d 100644 --- a/cookbook/logging/monolog.rst +++ b/cookbook/logging/monolog.rst @@ -229,14 +229,8 @@ Monolog allows you to process the record before logging it to add some extra data. A processor can be applied for the whole handler stack or only for a specific handler. -.. tip:: - - Beware that log file sizes can grow very rapidly, leading to disk space exhaustion. - This is specially true in the ``dev`` environment, where a simple request can - generate hundreds of log lines. Consider using tools like the ``logrotate`` - Linux command to contain log files before they become a problem. - A processor is simply a callable receiving the record as its first argument. + Processors are configured using the ``monolog.processor`` DIC tag. See the :ref:`reference about it `. From bcd0d6893f0c1974c4c2640e0c745007c23ea721 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 18 Feb 2015 16:38:06 +0100 Subject: [PATCH 3/5] Added a note about how to enable http_method_override for caching kernels --- book/http_cache.rst | 17 +++++++++++++++++ reference/configuration/framework.rst | 9 ++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/book/http_cache.rst b/book/http_cache.rst index 5cae7a710e2..561ed2535e6 100644 --- a/book/http_cache.rst +++ b/book/http_cache.rst @@ -163,6 +163,23 @@ kernel:: The caching kernel will immediately act as a reverse proxy - caching responses from your application and returning them to the client. +..caution:: + + By default, the caching kernel ignores the ``framework.http_method_override`` + option, which could lead to errors when using ``PUT``, ``DELETE`` and ``PURGE`` + methods in HTTP requests. + + Invoke the ``enableHttpMethodParameterOverride()`` method before creating the + ``Request`` object in order to take this option into account:: + + // web/app.php + // ... + $kernel = new AppCache($kernel); + + Request::enableHttpMethodParameterOverride(); // <-- add this line + $request = Request::createFromGlobals(); + // ... + .. tip:: The cache kernel has a special ``getLog()`` method that returns a string diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 5c871545081..b5493d3495c 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -77,9 +77,12 @@ http_method_override This determines whether the ``_method`` request parameter is used as the intended HTTP method on POST requests. If enabled, the :method:`Request::enableHttpMethodParameterOverride ` -method gets called automatically. It becomes the service container parameter -named ``kernel.http_method_override``. For more information, see -:doc:`/cookbook/routing/method_parameters`. +method gets called automatically, unless the application uses a caching kernel, +where you need to invoke that method manually (see :ref:`symfony2-reverse-proxy` +for details). + +It becomes the service container parameter named ``kernel.http_method_override``. +For more information, see :doc:`/cookbook/routing/method_parameters`. ide ~~~ From 5b71fdac0c47bce6b228b246644df422bfa229db Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 20 Feb 2015 08:20:10 +0100 Subject: [PATCH 4/5] Minor fixes --- book/http_cache.rst | 3 ++- reference/configuration/framework.rst | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/book/http_cache.rst b/book/http_cache.rst index 561ed2535e6..927a249d168 100644 --- a/book/http_cache.rst +++ b/book/http_cache.rst @@ -163,7 +163,7 @@ kernel:: The caching kernel will immediately act as a reverse proxy - caching responses from your application and returning them to the client. -..caution:: +.. caution:: By default, the caching kernel ignores the ``framework.http_method_override`` option, which could lead to errors when using ``PUT``, ``DELETE`` and ``PURGE`` @@ -173,6 +173,7 @@ from your application and returning them to the client. ``Request`` object in order to take this option into account:: // web/app.php + // ... $kernel = new AppCache($kernel); diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index b5493d3495c..5c871545081 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -77,12 +77,9 @@ http_method_override This determines whether the ``_method`` request parameter is used as the intended HTTP method on POST requests. If enabled, the :method:`Request::enableHttpMethodParameterOverride ` -method gets called automatically, unless the application uses a caching kernel, -where you need to invoke that method manually (see :ref:`symfony2-reverse-proxy` -for details). - -It becomes the service container parameter named ``kernel.http_method_override``. -For more information, see :doc:`/cookbook/routing/method_parameters`. +method gets called automatically. It becomes the service container parameter +named ``kernel.http_method_override``. For more information, see +:doc:`/cookbook/routing/method_parameters`. ide ~~~ From 4600e75a2c01020b22aded52d5eb4a3cfe8cc281 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 20 Feb 2015 12:09:58 +0100 Subject: [PATCH 5/5] Last rewording of the caution note --- book/http_cache.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/http_cache.rst b/book/http_cache.rst index 927a249d168..a039c066d2a 100644 --- a/book/http_cache.rst +++ b/book/http_cache.rst @@ -165,7 +165,7 @@ from your application and returning them to the client. .. caution:: - By default, the caching kernel ignores the ``framework.http_method_override`` + By default, a kernel based on the cache ignores the ``framework.http_method_override`` option, which could lead to errors when using ``PUT``, ``DELETE`` and ``PURGE`` methods in HTTP requests.