Skip to content

Added a note about log file sizes and the use of logrotate #5006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions cookbook/logging/monolog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 rotate 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 <dic_tags-monolog-processor>`.

Expand Down Expand Up @@ -473,4 +479,5 @@ the ``monolog.processor`` tag:
->addArgument(new Reference('session'))
->addTag('monolog.processor', array('method' => 'processRecord', 'channel' => 'main'));

.. _Monolog: https://github.com/Seldaek/monolog
.. _`Monolog`: https://github.com/Seldaek/monolog
.. _`logrotate`: https://fedorahosted.org/logrotate/