We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3043867 commit 0a5be4cCopy full SHA for 0a5be4c
logging.rst
@@ -250,6 +250,25 @@ which they are defined:
250
251
.. _logging-handler-fingers_crossed:
252
253
+
254
+.. note::
255
256
+ You can use the ``enabled`` option to enable or disable a handler depending
257
+ on the environment. For example, you can keep logging in ``dev`` and ``prod``
258
+ but disable it in ``staging``:
259
260
+ .. code-block:: yaml
261
262
+ monolog:
263
+ handlers:
264
+ file_log:
265
+ type: stream
266
+ path: "%kernel.logs_dir%/%kernel.environment%.log"
267
+ level: debug
268
+ enabled: false # disables the handler
269
270
+ When ``enabled`` is set to ``false``, the handler is completely ignored.
271
272
Handlers that Modify Log Entries
273
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
274
0 commit comments