Constants

MAX_CHUNK_SIZE

MAX_CHUNK_SIZE = 2147483647

DEFAULT_CHUNK_SIZE

DEFAULT_CHUNK_SIZE = 10 * 1024 * 1024

FILE_PER_DAY

FILE_PER_DAY = 'Y-m-d'

FILE_PER_MONTH

FILE_PER_MONTH = 'Y-m'

FILE_PER_YEAR

FILE_PER_YEAR = 'Y'

Properties

$streamChunkSize

$streamChunkSize : int

Type

int

$url

$url : ?string

Type

?string

$filePermission

$filePermission : ?int

Type

?int

$useLocking

$useLocking : bool

Type

bool

$processors

$processors : callable[]

Type

callable[]

$formatter

$formatter : ?\Monolog\Formatter\FormatterInterface

Type

FormatterInterface

$level

$level : int

Type

int

$bubble

$bubble : bool

Type

bool

$filename

$filename : string

Type

string

$maxFiles

$maxFiles : int

Type

int

$mustRotate

$mustRotate : bool

Type

bool

$nextRotation

$nextRotation : \DateTimeImmutable

Type

\DateTimeImmutable —

$filenameFormat

$filenameFormat : string

Type

string

$dateFormat

$dateFormat : string

Type

string

$errorMessage

$errorMessage : ?string

Type

?string

$dirCreated

$dirCreated : true|null

Type

true|null

Methods

__construct()

__construct(string  $filename, int  $maxFiles, mixed  $level = Logger::DEBUG, bool  $bubble = true, int|null  $filePermission = null, bool  $useLocking = false) : mixed

Parameters

string $filename
int $maxFiles

The maximal amount of files to keep (0 means unlimited)

mixed $level
bool $bubble
int|null $filePermission

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

bool $useLocking

Try to lock log file before doing any writes

Returns

mixed —

close()

close() : void

{@inheritDoc}

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 —

getStreamChunkSize()

getStreamChunkSize() : int

Returns

int —

handle()

handle(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

reset()

reset() : mixed

{@inheritDoc}

Returns

mixed —

pushProcessor()

pushProcessor(callable  $callback) : \Monolog\Handler\HandlerInterface

{@inheritDoc}

Parameters

callable $callback

Returns

\Monolog\Handler\HandlerInterface —

popProcessor()

popProcessor() : callable

{@inheritDoc}

Returns

callable —

setFormatter()

setFormatter(\Monolog\Formatter\FormatterInterface  $formatter) : \Monolog\Handler\HandlerInterface

{@inheritDoc}

Parameters

\Monolog\Formatter\FormatterInterface $formatter

Returns

\Monolog\Handler\HandlerInterface —

getFormatter()

getFormatter() : \Monolog\Formatter\FormatterInterface

{@inheritDoc}

Returns

\Monolog\Formatter\FormatterInterface —

isHandling()

isHandling(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

setLevel()

setLevel(mixed  $level) : self

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

Parameters

mixed $level

Returns

self —

getLevel()

getLevel() : int

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

Returns

int —

setBubble()

setBubble(bool  $bubble) : self

Sets the bubbling behavior.

Parameters

bool $bubble

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

Returns

self —

getBubble()

getBubble() : bool

Gets the bubbling behavior.

Returns

bool —

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

handleBatch()

handleBatch(array  $records) : void

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

__destruct()

__destruct() : mixed

Returns

mixed —

__sleep()

__sleep() : mixed

Returns

mixed —

setFilenameFormat()

setFilenameFormat(string  $filenameFormat, string  $dateFormat) : self

Parameters

string $filenameFormat
string $dateFormat

Returns

self —

write()

write(array  $record) : void

Writes the record down to the log of the implementing handler

Parameters

array $record

streamWrite()

streamWrite(resource  $stream, array  $record) : void

Write to stream

Parameters

resource $stream
array $record

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array —

resetProcessors()

resetProcessors() : void

getDefaultFormatter()

getDefaultFormatter() : \Monolog\Formatter\FormatterInterface

Gets the default formatter.

Overwrite this if the LineFormatter is not a good default for your handler.

Returns

\Monolog\Formatter\FormatterInterface —

rotate()

rotate() : void

Rotates the files.

getTimedFilename()

getTimedFilename() : string

Returns

string —

getGlobPattern()

getGlobPattern() : string

Returns

string —

customErrorHandler()

customErrorHandler(int  $code, string  $msg) : bool

Parameters

int $code
string $msg

Returns

bool —

getDirFromStream()

getDirFromStream(string  $stream) : ?string

Parameters

string $stream

Returns

?string —

createDir()

createDir(string  $url) : void

Parameters

string $url