$level
$level :
Buffers all records until a certain level is reached
The advantage of this approach is that you don't get any clutter in your log files. Only requests which actually trigger an error (or whatever your actionLevel is) will be in the logs, but they will contain all records, not only those above the level threshold.
You can find the various activation strategies in the Monolog\Handler\FingersCrossed\ namespace.
$formatter : \Monolog\Formatter\FormatterInterface
__construct(callable|\Monolog\Handler\HandlerInterface $handler, integer|\Monolog\Handler\FingersCrossed\ActivationStrategyInterface $activationStrategy = null, integer $bufferSize, Boolean $bubble = true, Boolean $stopBuffering = true, integer $passthruLevel = null)
callable|\Monolog\Handler\HandlerInterface | $handler | Handler or factory callable($record, $fingersCrossedHandler). |
integer|\Monolog\Handler\FingersCrossed\ActivationStrategyInterface | $activationStrategy | Strategy which determines when this handler takes action |
integer | $bufferSize | How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. |
Boolean | $bubble | Whether the messages that are handled can bubble up the stack or not |
Boolean | $stopBuffering | Whether the handler should stop buffering after being triggered (default true) |
integer | $passthruLevel | Minimum level to always flush to handler on close, even if strategy not triggered |
isHandling(array $record) : Boolean
Checks whether the given record will be handled by this handler.
This is mostly done for performance reasons, to avoid calling processors for nothing.
Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.
array | $record | Partial log record containing only a level key |
setFormatter(\Monolog\Formatter\FormatterInterface $formatter) : self
Sets the formatter.
\Monolog\Formatter\FormatterInterface | $formatter |
getFormatter() : \Monolog\Formatter\FormatterInterface
Gets the formatter.
getDefaultFormatter() : \Monolog\Formatter\FormatterInterface
Gets the default formatter.