$handler
$handler : \Monolog\Handler\HandlerInterface
Simple handler wrapper that deduplicates log records across multiple requests
It also includes the BufferHandler functionality and will buffer all messages until the end of the request or flush() is called.
This works by storing all log records' messages above $deduplicationLevel to the file specified by $deduplicationStore. When further logs come in at the end of the request (or when flush() is called), all those above $deduplicationLevel are checked against the existing stored logs. If they match and the timestamps in the stored log is not older than $time seconds, the new log record is discarded. If no log record is new, the whole data set is discarded.
This is mainly useful in combination with Mail handlers or things like Slack or HipChat handlers that send messages to people, to avoid spamming with the same message over and over in case of a major component failure like a database server being down which makes all requests fail in the same way.
$handler : \Monolog\Handler\HandlerInterface
$bufferSize : int
$bufferLimit : int
$flushOnOverflow : bool
$buffer : \Monolog\Handler\Record[]
$initialized : bool
$processors : callable[]
$level : int
$bubble : bool
$deduplicationStore : string
$time : int
$gc : bool
__construct(\Monolog\Handler\HandlerInterface $handler, string $deduplicationStore = null, string|int $deduplicationLevel = Logger::ERROR, int $time = 60, bool $bubble = true) : mixed
\Monolog\Handler\HandlerInterface | $handler | Handler. |
string | $deduplicationStore | The file/path where the deduplication log should be kept |
string|int | $deduplicationLevel | The minimum logging level for log records to be looked at for deduplication purposes |
int | $time | The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through |
bool | $bubble | Whether the messages that are handled can bubble up the stack or not |