Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0c1ea2

Browse files
committed
Tweaks
1 parentd094c8d commitb0c1ea2

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

‎logging/processors.rst‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,28 +165,30 @@ handler level or at the channel level instead of registering it globally
165165
(see the following sections).
166166

167167
When registering a new processor, instead of adding the tag manually in your
168-
configuration files, you cantake full advantage ofthe ``#[AsMonologProcessor]``
169-
attribute by usingitone the processor class::
168+
configuration files, you canusethe ``#[AsMonologProcessor]`` attribute to
169+
applyiton the processor class::
170170

171171
// src/Logger/SessionRequestProcessor.php
172172
namespace App\Logger;
173173

174174
use Monolog\Attribute\AsMonologProcessor;
175-
// ...
176175

177176
#[AsMonologProcessor]
178177
class SessionRequestProcessor
179178
{
180179
// ...
181180
}
182181

183-
The ``#[AsMonologProcessor]`` attribute takes3 optional arguments:
182+
The ``#[AsMonologProcessor]`` attribute takesthese optional arguments:
184183

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.
190192

191193
Symfony's MonologBridge provides processors that can be registered inside your application.
192194

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp