Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ to write logs using the :phpfunction:`syslog` function:
.. code-block:: php

// config/packages/prod/monolog.php
use Psr\Log\LogLevel;
use Symfony\Config\MonologConfig;

return static function (MonologConfig $monolog) {
Expand All @@ -163,12 +164,12 @@ to write logs using the :phpfunction:`syslog` function:
// log to var/logs/(environment).log
->path('%kernel.logs_dir%/%kernel.environment%.log')
// log *all* messages (debug is lowest level)
->level('debug');
->level(LogLevel::DEBUG);

$monolog->handler('syslog_handler')
->type('syslog')
// log error-level messages and higher
->level('error');
->level(LogLevel::ERROR);
};

This defines a *stack* of handlers and each handler is called in the order that it's
Expand Down