File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
How to Add extra Data to Log Messages via a Processor
2
2
=====================================================
3
3
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 .
7
7
8
8
A processor is a callable receiving the record as its first argument.
9
9
Processors are configured using the ``monolog.processor `` DIC tag. See the
@@ -46,6 +46,11 @@ using a processor::
46
46
}
47
47
}
48
48
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
+
49
54
Next, register your class as a service, as well as a formatter that uses the extra
50
55
information:
51
56
You can’t perform that action at this time.
0 commit comments