Skip to content
Open
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
21 changes: 21 additions & 0 deletions logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,27 @@

.. _logging-handler-fingers_crossed:


.. versionadded:: 3.11.0

Check failure on line 254 in logging.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please only provide ".. versionadded::" if the version is greater/equal "7.0"

Check failure on line 254 in logging.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

You are not allowed to use version "3.11.0". Only major version "7" is allowed.

The ``enabled`` option was introduced in Monolog 3.11.0.

Check failure on line 256 in logging.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please remove trailing whitespace

You can use the ``enabled`` option to enable or disable a handler depending
on the environment. For example, you can keep logging in ``dev`` and ``prod``
but disable it in ``staging``:

.. code-block:: yaml

monolog:
handlers:
file_log:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
enabled: false # disables the handler

When ``enabled`` is set to ``false``, the handler is completely ignored.

Handlers that Modify Log Entries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down