Skip to content

Commit 7be32d8

Browse files
Update processors.rst
1 parent 76be978 commit 7be32d8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

logging/processors.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
How to Add extra Data to Log Messages via a Processor
22
=====================================================
33

4-
Monolog allows you to process the record before logging it to add some
5-
extra data. A processor can be applied for the whole handler stack or
6-
only for a specific handler.
4+
Monolog allows you to process every record before logging it by adding some
5+
extra data. This is the role of a processor, which can be applied for the whole
6+
handler stack or only for a specific handler or channel.
77

88
A processor is a callable receiving the record as its first argument.
99
Processors are configured using the ``monolog.processor`` DIC tag. See the
@@ -46,6 +46,11 @@ using a processor::
4646
}
4747
}
4848

49+
.. note::
50+
51+
As every log record is process by all registred processors, you must be very careful when you create one processor.
52+
It has to be an optimized process, to not introduce any overhead.
53+
4954
Next, register your class as a service, as well as a formatter that uses the extra
5055
information:
5156

0 commit comments

Comments
 (0)