\Monolog\HandlerTestHandler

Used for testing purposes.

It records all records and gives you access to them for verification.

Summary

Methods
Properties
Constants
handle()
__construct()
isHandling()
handleBatch()
close()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
setLevel()
getLevel()
setBubble()
getBubble()
__destruct()
getRecords()
clear()
hasRecords()
hasRecord()
hasRecordThatContains()
hasRecordThatMatches()
hasRecordThatPasses()
__call()
hasEmergency()
hasAlert()
hasCritical()
hasError()
hasWarning()
hasNotice()
hasInfo()
hasDebug()
hasEmergencyRecords()
hasAlertRecords()
hasCriticalRecords()
hasErrorRecords()
hasWarningRecords()
hasNoticeRecords()
hasInfoRecords()
hasDebugRecords()
hasEmergencyThatContains()
hasAlertThatContains()
hasCriticalThatContains()
hasErrorThatContains()
hasWarningThatContains()
hasNoticeThatContains()
hasInfoThatContains()
hasDebugThatContains()
hasEmergencyThatMatches()
hasAlertThatMatches()
hasCriticalThatMatches()
hasErrorThatMatches()
hasWarningThatMatches()
hasNoticeThatMatches()
hasInfoThatMatches()
hasDebugThatMatches()
hasEmergencyThatPasses()
hasAlertThatPasses()
hasCriticalThatPasses()
hasErrorThatPasses()
hasWarningThatPasses()
hasNoticeThatPasses()
hasInfoThatPasses()
hasDebugThatPasses()
No public properties found
No constants found
write()
processRecord()
getDefaultFormatter()
$level
$bubble
$formatter
$processors
$records
$recordsByLevel
N/A
No private methods found
No private properties found
N/A

Properties

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$records

$records : 

Type

$recordsByLevel

$recordsByLevel : 

Type

Methods

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

__construct()

__construct(integer  $level = \Monolog\Logger::DEBUG, Boolean  $bubble = true) 

Parameters

integer $level

The minimum logging level at which this handler will be triggered

Boolean $bubble

Whether the messages that are handled can bubble up the stack or not

isHandling()

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.

Parameters

array $record

Partial log record containing only a level key

Returns

Boolean

handleBatch()

handleBatch(array  $records) 

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

close()

close() 

Closes the handler.

This will be called automatically when the object is destroyed

pushProcessor()

pushProcessor(callable  $callback) : self

Adds a processor in the stack.

Parameters

callable $callback

Returns

self

popProcessor()

popProcessor() : callable

Removes the processor on top of the stack and returns it.

Returns

callable

setLevel()

setLevel(integer|string  $level) : self

Sets minimum logging level at which this handler will be triggered.

Parameters

integer|string $level

Level or level name

Returns

self

getLevel()

getLevel() : integer

Gets minimum logging level at which this handler will be triggered.

Returns

integer

setBubble()

setBubble(Boolean  $bubble) : self

Sets the bubbling behavior.

Parameters

Boolean $bubble

true means that this handler allows bubbling. false means that bubbling is not permitted.

Returns

self

getBubble()

getBubble() : Boolean

Gets the bubbling behavior.

Returns

Boolean —

true means that this handler allows bubbling. false means that bubbling is not permitted.

__destruct()

__destruct() 

getRecords()

getRecords() 

clear()

clear() 

hasRecords()

hasRecords(  $level) 

Parameters

$level

hasRecord()

hasRecord(  $record,   $level) 

Parameters

$record
$level

hasRecordThatContains()

hasRecordThatContains(  $message,   $level) 

Parameters

$message
$level

hasRecordThatMatches()

hasRecordThatMatches(  $regex,   $level) 

Parameters

$regex
$level

hasRecordThatPasses()

hasRecordThatPasses(  $predicate,   $level) 

Parameters

$predicate
$level

__call()

__call(  $method,   $args) 

Parameters

$method
$args

hasEmergency()

hasEmergency(mixed  $record) : boolean

Parameters

mixed $record

Returns

boolean

hasAlert()

hasAlert(mixed  $record) : boolean

Parameters

mixed $record

Returns

boolean

hasCritical()

hasCritical(mixed  $record) : boolean

Parameters

mixed $record

Returns

boolean

hasError()

hasError(mixed  $record) : boolean

Parameters

mixed $record

Returns

boolean

hasWarning()

hasWarning(mixed  $record) : boolean

Parameters

mixed $record

Returns

boolean

hasNotice()

hasNotice(mixed  $record) : boolean

Parameters

mixed $record

Returns

boolean

hasInfo()

hasInfo(mixed  $record) : boolean

Parameters

mixed $record

Returns

boolean

hasDebug()

hasDebug(mixed  $record) : boolean

Parameters

mixed $record

Returns

boolean

hasEmergencyRecords()

hasEmergencyRecords() : boolean

Returns

boolean

hasAlertRecords()

hasAlertRecords() : boolean

Returns

boolean

hasCriticalRecords()

hasCriticalRecords() : boolean

Returns

boolean

hasErrorRecords()

hasErrorRecords() : boolean

Returns

boolean

hasWarningRecords()

hasWarningRecords() : boolean

Returns

boolean

hasNoticeRecords()

hasNoticeRecords() : boolean

Returns

boolean

hasInfoRecords()

hasInfoRecords() : boolean

Returns

boolean

hasDebugRecords()

hasDebugRecords() : boolean

Returns

boolean

hasEmergencyThatContains()

hasEmergencyThatContains(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasAlertThatContains()

hasAlertThatContains(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasCriticalThatContains()

hasCriticalThatContains(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasErrorThatContains()

hasErrorThatContains(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasWarningThatContains()

hasWarningThatContains(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasNoticeThatContains()

hasNoticeThatContains(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasInfoThatContains()

hasInfoThatContains(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasDebugThatContains()

hasDebugThatContains(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasEmergencyThatMatches()

hasEmergencyThatMatches(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasAlertThatMatches()

hasAlertThatMatches(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasCriticalThatMatches()

hasCriticalThatMatches(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasErrorThatMatches()

hasErrorThatMatches(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasWarningThatMatches()

hasWarningThatMatches(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasNoticeThatMatches()

hasNoticeThatMatches(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasInfoThatMatches()

hasInfoThatMatches(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasDebugThatMatches()

hasDebugThatMatches(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasEmergencyThatPasses()

hasEmergencyThatPasses(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasAlertThatPasses()

hasAlertThatPasses(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasCriticalThatPasses()

hasCriticalThatPasses(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasErrorThatPasses()

hasErrorThatPasses(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasWarningThatPasses()

hasWarningThatPasses(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasNoticeThatPasses()

hasNoticeThatPasses(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasInfoThatPasses()

hasInfoThatPasses(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

hasDebugThatPasses()

hasDebugThatPasses(mixed  $message) : boolean

Parameters

mixed $message

Returns

boolean

write()

write(array  $record) : void

Writes the record down to the log of the implementing handler

Parameters

array $record

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array