43 if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) {
44 throw new \InvalidArgumentException(
'Predis\Client or Redis instance required');
47 $this->redisClient = $redis;
48 $this->redisKey = $key;
62 $this->redisClient->rpush($this->redisKey, $record[
"formatted"]);
75 if ($this->redisClient instanceof \Redis) {
76 $this->redisClient->multi()
77 ->rpush($this->redisKey, $record[
"formatted"])
78 ->ltrim($this->redisKey, -$this->capSize, -1)
83 $this->redisClient->transaction(
function ($tx) use ($record,
$redisKey,
$capSize) {
84 $tx->rpush(
$redisKey, $record[
"formatted"]);
__construct($redis, $key, $level=Logger::DEBUG, $bubble=true, $capSize=false)
const DEBUG
Detailed debug information.
Base Handler class providing the Handler structure.
Logs to a Redis key using rpush.
writeCapped(array $record)
Write and cap the collection Writes the record to the redis list and caps its.
Create styles array
The data for the language used.