76        if ($this->bufferSize === 0) {
 
   82        foreach ($this->buffer as $record) {
 
   83            if ($record[
'level'] >= $this->deduplicationLevel) {
 
   85                $passthru = $passthru || !$this->
isDuplicate($record);
 
   93        if ($passthru === 
true || $passthru === 
null) {
 
   94            $this->handler->handleBatch($this->buffer);
 
  106        if (!file_exists($this->deduplicationStore)) {
 
  110        $store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
 
  115        $yesterday = time() - 86400;
 
  116        $timestampValidity = $record[
'datetime']->getTimestamp() - 
$this->time;
 
  117        $expectedMessage = preg_replace(
'{[\r\n].*}', 
'', $record[
'message']);
 
  136        if (!file_exists($this->deduplicationStore)) {
 
  140        $handle = fopen($this->deduplicationStore, 
'rw+');
 
  141        flock($handle, LOCK_EX);
 
  142        $validLogs = array();
 
  146        while (!feof($handle)) {
 
  147            $log = fgets($handle);
 
  148            if (substr(
$log, 0, 10) >= $timestampValidity) {
 
  153        ftruncate($handle, 0);
 
  155        foreach ($validLogs as 
$log) {
 
  156            fwrite($handle, 
$log);
 
  159        flock($handle, LOCK_UN);
 
  167        file_put_contents($this->deduplicationStore, $record[
'datetime']->getTimestamp() . 
':' . $record[
'level_name'] . 
':' . preg_replace(
'{[\r\n].*}', 
'', $record[
'message']) . 
"\n", FILE_APPEND);
 
foreach($mandatory_scripts as $file) $timestamp
An exception for terminatinating execution or to throw for unit testing.
Buffers all records until closing the handler and then pass them as batch.
clear()
Clears the buffer without flushing any messages down to the wrapped handler.
Simple handler wrapper that deduplicates log records across multiple requests.
isDuplicate(array $record)
appendRecord(array $record)
__construct(HandlerInterface $handler, $deduplicationStore=null, $deduplicationLevel=Logger::ERROR, $time=60, $bubble=true)
static toMonologLevel($level)
Converts PSR-3 levels to Monolog ones if necessary.
const ERROR
Runtime errors.
const DEBUG
Detailed debug information.
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
Interface that all Monolog Handlers must implement.
catch(Exception $e) $message