Skip to content

Commit 68ca2af

Browse files
committed
minor symfony#19670 [Logger] Using LogLevel consts (ThomasLandauer)
This PR was merged into the 5.4 branch. Discussion ---------- [Logger] Using LogLevel `const`s Page: https://symfony.com/doc/5.x/logging.html If you agree, I'll replace the remaining occurrences. Commits ------- 776f1d4 [Logger] Using LogLevel `const`s
2 parents f2f380d + 776f1d4 commit 68ca2af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

logging.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ to write logs using the :phpfunction:`syslog` function:
154154
.. code-block:: php
155155
156156
// config/packages/prod/monolog.php
157+
use Psr\Log\LogLevel;
157158
use Symfony\Config\MonologConfig;
158159
159160
return static function (MonologConfig $monolog) {
@@ -163,12 +164,12 @@ to write logs using the :phpfunction:`syslog` function:
163164
// log to var/logs/(environment).log
164165
->path('%kernel.logs_dir%/%kernel.environment%.log')
165166
// log *all* messages (debug is lowest level)
166-
->level('debug');
167+
->level(LogLevel::DEBUG);
167168
168169
$monolog->handler('syslog_handler')
169170
->type('syslog')
170171
// log error-level messages and higher
171-
->level('error');
172+
->level(LogLevel::ERROR);
172173
};
173174
174175
This defines a *stack* of handlers and each handler is called in the order that it's

0 commit comments

Comments
 (0)