File tree 1 file changed +11
-9
lines changed
Filter options
1 file changed +11
-9
lines changed
Original file line number Diff line number Diff line change @@ -165,28 +165,30 @@ handler level or at the channel level instead of registering it globally
165
165
(see the following sections).
166
166
167
167
When registering a new processor, instead of adding the tag manually in your
168
- configuration files, you can take full advantage of the ``#[AsMonologProcessor] ``
169
- attribute by using it one the processor class::
168
+ configuration files, you can use the ``#[AsMonologProcessor] `` attribute to
169
+ apply it on the processor class::
170
170
171
171
// src/Logger/SessionRequestProcessor.php
172
172
namespace App\Logger;
173
173
174
174
use Monolog\Attribute\AsMonologProcessor;
175
- // ...
176
175
177
176
#[AsMonologProcessor]
178
177
class SessionRequestProcessor
179
178
{
180
179
// ...
181
180
}
182
181
183
- The ``#[AsMonologProcessor] `` attribute takes 3 optional arguments:
182
+ The ``#[AsMonologProcessor] `` attribute takes these optional arguments:
184
183
185
- * ``channel ``: the logging channel the processor should be pushed to
186
- * ``handler ``: the handler the processor should be pushed to
187
- * ``method ``: the method that processes the records (if the attribute is used
188
- at the class level). Indeed, the attribute can also be used directly
189
- on a class method.
184
+ * ``channel ``: the logging channel the processor should be pushed to;
185
+ * ``handler ``: the handler the processor should be pushed to;
186
+ * ``method ``: the method that processes the records (useful when applying
187
+ the attribute to the entire class instead of a single method).
188
+
189
+ .. versionadded :: 3.8
190
+
191
+ The ``#[AsMonologProcessor] `` attribute was introduced in MonologBundle 3.8.
190
192
191
193
Symfony's MonologBridge provides processors that can be registered inside your application.
192
194
You can’t perform that action at this time.
0 commit comments