From 30656220f3d47570ff271e870d2130a0fd18f565 Mon Sep 17 00:00:00 2001 From: Ricardo de Vries Date: Wed, 29 Nov 2017 07:40:16 +0100 Subject: [PATCH 1/5] Remove the smaal article. --- logging/disable_microsecond_precision.rst | 42 ----------------------- 1 file changed, 42 deletions(-) delete mode 100644 logging/disable_microsecond_precision.rst diff --git a/logging/disable_microsecond_precision.rst b/logging/disable_microsecond_precision.rst deleted file mode 100644 index d7b922d7cca..00000000000 --- a/logging/disable_microsecond_precision.rst +++ /dev/null @@ -1,42 +0,0 @@ -How to Disable Microseconds Precision (for a Performance Boost) -=============================================================== - -Setting the parameter ``use_microseconds`` to ``false`` forces the logger to reduce -the precision in the ``datetime`` field of the log messages from microsecond to second, -avoiding a call to the ``microtime(true)`` function and the subsequent parsing. -Disabling the use of microseconds can provide a small performance gain speeding up the -log generation. This is recommended for systems that generate a large number of log events. - -.. configuration-block:: - - .. code-block:: yaml - - # config/packages/monolog.yaml - monolog: - use_microseconds: false - # ... - - .. code-block:: xml - - - - - - - - - - - .. code-block:: php - - // config/packages/monolog.php - $container->loadFromExtension('monolog', array( - 'use_microseconds' => false, - // ... - )); From 2519c7af3d072680ea21a1ecf559af2ee1e2abb2 Mon Sep 17 00:00:00 2001 From: Ricardo de Vries Date: Wed, 29 Nov 2017 07:40:42 +0100 Subject: [PATCH 2/5] Added block to main article. --- logging.rst | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/logging.rst b/logging.rst index 46e7c25e738..f399f8ee631 100644 --- a/logging.rst +++ b/logging.rst @@ -323,6 +323,49 @@ specific channel (``app`` by default), use the ``monolog.logger`` tag with the ``channel`` property as explained in the :ref:`Dependency Injection reference `. +How to Disable Microseconds Precision (for a Performance Boost) +--------------------------------------------------------------- + +Setting the parameter ``use_microseconds`` to ``false`` forces the logger to reduce +the precision in the ``datetime`` field of the log messages from microsecond to second, +avoiding a call to the ``microtime(true)`` function and the subsequent parsing. +Disabling the use of microseconds can provide a small performance gain speeding up the +log generation. This is recommended for systems that generate a large number of log events. + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/monolog.yaml + monolog: + use_microseconds: false + # ... + + .. code-block:: xml + + + + + + + + + + + .. code-block:: php + + // config/packages/monolog.php + $container->loadFromExtension('monolog', array( + 'use_microseconds' => false, + // ... + )); + Adding extra Data to each Log (e.g. a unique request token) ----------------------------------------------------------- @@ -343,7 +386,6 @@ Learn more logging/processors logging/monolog_regex_based_excludes logging/monolog_console - logging/disable_microsecond_precision .. _Monolog: https://github.com/Seldaek/monolog .. _LoggerInterface: https://github.com/php-fig/log/blob/master/Psr/Log/LoggerInterface.php From 1b16d2ddea52449becc5c8f8cbc80457f84c300d Mon Sep 17 00:00:00 2001 From: Ricardo de Vries Date: Fri, 1 Dec 2017 20:33:39 +0100 Subject: [PATCH 3/5] Removing the entire section from the article. --- logging.rst | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/logging.rst b/logging.rst index f399f8ee631..8a0cd772b61 100644 --- a/logging.rst +++ b/logging.rst @@ -323,49 +323,6 @@ specific channel (``app`` by default), use the ``monolog.logger`` tag with the ``channel`` property as explained in the :ref:`Dependency Injection reference `. -How to Disable Microseconds Precision (for a Performance Boost) ---------------------------------------------------------------- - -Setting the parameter ``use_microseconds`` to ``false`` forces the logger to reduce -the precision in the ``datetime`` field of the log messages from microsecond to second, -avoiding a call to the ``microtime(true)`` function and the subsequent parsing. -Disabling the use of microseconds can provide a small performance gain speeding up the -log generation. This is recommended for systems that generate a large number of log events. - -.. configuration-block:: - - .. code-block:: yaml - - # config/packages/monolog.yaml - monolog: - use_microseconds: false - # ... - - .. code-block:: xml - - - - - - - - - - - .. code-block:: php - - // config/packages/monolog.php - $container->loadFromExtension('monolog', array( - 'use_microseconds' => false, - // ... - )); - Adding extra Data to each Log (e.g. a unique request token) ----------------------------------------------------------- From 4b3ed43060414955021a8ba80b4802326fb67cd4 Mon Sep 17 00:00:00 2001 From: Ricardo de Vries Date: Fri, 1 Dec 2017 20:34:20 +0100 Subject: [PATCH 4/5] Added 'use_microseconds' to the monolog configuration. --- reference/configuration/monolog.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/reference/configuration/monolog.rst b/reference/configuration/monolog.rst index c2db56b574d..bb43fd885ec 100644 --- a/reference/configuration/monolog.rst +++ b/reference/configuration/monolog.rst @@ -74,6 +74,11 @@ Full Default Configuration id: ~ # Required (when the email_prototype is used) method: ~ formatter: ~ + # Setting this parameter to false forces the logger to reduce + # the precision in the datetime field of the log messages from + # microsecond to second. Avoiding a call to the microtime(true) + # function and the subsequent parsing. + use_microseconds: true .. code-block:: xml @@ -86,7 +91,13 @@ Full Default Configuration http://symfony.com/schema/dic/monolog http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> - + + Date: Sat, 2 Dec 2017 13:02:50 +0100 Subject: [PATCH 5/5] Improvements on the comments. --- reference/configuration/monolog.rst | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/reference/configuration/monolog.rst b/reference/configuration/monolog.rst index bb43fd885ec..5ecda0c31db 100644 --- a/reference/configuration/monolog.rst +++ b/reference/configuration/monolog.rst @@ -74,10 +74,8 @@ Full Default Configuration id: ~ # Required (when the email_prototype is used) method: ~ formatter: ~ - # Setting this parameter to false forces the logger to reduce - # the precision in the datetime field of the log messages from - # microsecond to second. Avoiding a call to the microtime(true) - # function and the subsequent parsing. + # Set to false to use seconds (instead of microseconds) in + # the logs (gives a small performance boost). use_microseconds: true .. code-block:: xml @@ -91,12 +89,6 @@ Full Default Configuration http://symfony.com/schema/dic/monolog http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> -