Skip to content

Commit 62a2a10

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [Logger] Using LogLevel `const`s
2 parents cf29248 + 68ca2af commit 62a2a10

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
@@ -155,6 +155,7 @@ to write logs using the :phpfunction:`syslog` function:
155155
.. code-block:: php
156156
157157
// config/packages/prod/monolog.php
158+
use Psr\Log\LogLevel;
158159
use Symfony\Config\MonologConfig;
159160
160161
return static function (MonologConfig $monolog): void {
@@ -164,12 +165,12 @@ to write logs using the :phpfunction:`syslog` function:
164165
// log to var/logs/(environment).log
165166
->path('%kernel.logs_dir%/%kernel.environment%.log')
166167
// log *all* messages (debug is lowest level)
167-
->level('debug');
168+
->level(LogLevel::DEBUG);
168169
169170
$monolog->handler('syslog_handler')
170171
->type('syslog')
171172
// log error-level messages and higher
172-
->level('error');
173+
->level(LogLevel::ERROR);
173174
};
174175
175176
This defines a *stack* of handlers and each handler is called in the order that it's

0 commit comments

Comments
 (0)