Skip to content

Commit 74b6cf6

Browse files
committed
Fix incorrect PHP example to exclude HTTP code with Monolog
1 parent 2e413af commit 74b6cf6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

logging/monolog_exclude_http_codes.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ logging these HTTP codes based on the MonologBundle configuration:
5252
use Symfony\Config\MonologConfig;
5353
5454
return static function (MonologConfig $monolog) {
55-
$monolog->handler('main')
55+
$mainHandler = $monolog->handler('main')
5656
// ...
5757
->type('fingers_crossed')
5858
->handler(...)
59-
->excludedHttpCode([403, 404])
6059
;
60+
61+
$mainHandler->excludedHttpCode()->code(403);
62+
$mainHandler->excludedHttpCode()->code(404);
6163
};
6264
6365
.. caution::

0 commit comments

Comments
 (0)