25 @unlink(sys_get_temp_dir().
'/monolog_dedup.log');
33 $this->assertTrue(
$test->hasInfoRecords());
34 $this->assertTrue(
$test->hasDebugRecords());
35 $this->assertFalse(
$test->hasWarningRecords());
45 @unlink(sys_get_temp_dir().
'/monolog_dedup.log');
53 $this->assertTrue(
$test->hasErrorRecords());
54 $this->assertTrue(
$test->hasCriticalRecords());
55 $this->assertFalse(
$test->hasWarningRecords());
74 $this->assertFalse(
$test->hasErrorRecords());
75 $this->assertFalse(
$test->hasCriticalRecords());
76 $this->assertFalse(
$test->hasWarningRecords());
91 $record[
'datetime']->modify(
'+62seconds');
94 $record[
'datetime']->modify(
'+62seconds');
99 $this->assertTrue(
$test->hasErrorRecords());
100 $this->assertTrue(
$test->hasCriticalRecords());
101 $this->assertFalse(
$test->hasWarningRecords());
113 @unlink(sys_get_temp_dir().
'/monolog_dedup.log');
118 $record[
'datetime']->modify(
'-1day -10seconds');
121 $record2[
'datetime']->modify(
'-1day -10seconds');
124 $record3[
'datetime']->modify(
'-30seconds');
130 $record[
'datetime']->getTimestamp() .
":ERROR:test\n" .
131 $record2[
'datetime']->getTimestamp() .
":CRITICAL:test\n" .
132 $record3[
'datetime']->getTimestamp() .
":CRITICAL:test\n",
133 file_get_contents(sys_get_temp_dir() .
'/monolog_dedup.log')
135 $this->assertTrue(
$test->hasErrorRecords());
136 $this->assertTrue(
$test->hasCriticalRecords());
137 $this->assertFalse(
$test->hasWarningRecords());
141 $this->assertFalse(
$test->hasErrorRecords());
142 $this->assertFalse(
$test->hasCriticalRecords());
151 $record3[
'datetime']->getTimestamp() .
":CRITICAL:test\n" .
152 $record[
'datetime']->getTimestamp() .
":ERROR:test\n" .
153 $record2[
'datetime']->getTimestamp() .
":CRITICAL:test\n",
154 file_get_contents(sys_get_temp_dir() .
'/monolog_dedup.log')
156 $this->assertTrue(
$test->hasErrorRecords());
157 $this->assertTrue(
$test->hasCriticalRecords());
158 $this->assertFalse(
$test->hasWarningRecords());
163 @unlink(sys_get_temp_dir().
'/monolog_dedup.log');
An exception for terminatinating execution or to throw for unit testing.
testGcOldLogs()
@covers Monolog\Handler\DeduplicationHandler::flush @covers Monolog\Handler\DeduplicationHandler::app...
testFlushPassthruIfLogTooOld()
@covers Monolog\Handler\DeduplicationHandler::flush @covers Monolog\Handler\DeduplicationHandler::app...
testFlushPassthruIfEmptyLog()
@covers Monolog\Handler\DeduplicationHandler::flush @covers Monolog\Handler\DeduplicationHandler::app...
testFlushPassthruIfAllRecordsUnderTrigger()
@covers Monolog\Handler\DeduplicationHandler::flush
testFlushSkipsIfLogExists()
@covers Monolog\Handler\DeduplicationHandler::flush @covers Monolog\Handler\DeduplicationHandler::app...
static tearDownAfterClass()
Simple handler wrapper that deduplicates log records across multiple requests.
Used for testing purposes.
const ERROR
Runtime errors.
const CRITICAL
Critical conditions.
const INFO
Interesting events.
const DEBUG
Detailed debug information.
getRecord($level=Logger::WARNING, $message='test', $context=array())