Properties

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$stream

$stream : 

Type

$url

$url : 

Type

$filePermission

$filePermission : 

Type

$useLocking

$useLocking : 

Type

$errorMessage

$errorMessage : 

Type

$dirCreated

$dirCreated : 

Type

Methods

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

__construct()

__construct(resource|string  $stream, integer  $level = \Monolog\Logger::DEBUG, Boolean  $bubble = true, integer|null  $filePermission = null, Boolean  $useLocking = false) 

Parameters

resource|string $stream
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

integer|null $filePermission

Optional file permissions (default (0644) are only for owner read/write)

Boolean $useLocking

Try to lock log file before doing any writes

Throws

\Exception

If a missing directory is not buildable

\InvalidArgumentException

If stream is not a resource or string

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() 

{@inheritdoc}

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() 

getStream()

getStream() : resource|null

Return the currently active stream if it is open

Returns

resource|null

getUrl()

getUrl() : string|null

Return the stream URL if it was configured with a URL and not an active resource

Returns

string|null

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

streamWrite()

streamWrite(resource  $stream, array  $record) 

Write to stream

Parameters

resource $stream
array $record

customErrorHandler()

customErrorHandler(  $code,   $msg) 

Parameters

$code
$msg

getDirFromStream()

getDirFromStream(string  $stream) : null|string

Parameters

string $stream

Returns

null|string

createDir()

createDir()