Constants

FORMAT_HTML

FORMAT_HTML = 'html'

FORMAT_JS

FORMAT_JS = 'js'

FORMAT_UNKNOWN

FORMAT_UNKNOWN = 'unknown'

Properties

$processors

$processors : callable[]

Type

callable[]

$formatter

$formatter : ?\Monolog\Formatter\FormatterInterface

Type

FormatterInterface

$level

$level : int

Type

int

$bubble

$bubble : bool

Type

bool

$initialized

$initialized : bool

Type

bool

Methods

handle()

handle(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

reset()

reset() : void

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 —

__construct()

__construct(int|string  $level = Logger::DEBUG, bool  $bubble = true) : mixed

Parameters

int|string $level

The minimum logging level at which this handler will be triggered

bool $bubble

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

Returns

mixed —

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)

close()

close() : void

__destruct()

__destruct() : mixed

Returns

mixed —

__sleep()

__sleep() : mixed

Returns

mixed —

send()

send() : void

Convert records to javascript console commands and send it to the browser.

This method is automatically called on PHP shutdown if output is HTML or Javascript.

resetStatic()

resetStatic() : void

Forget all logged records

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 —

resetProcessors()

resetProcessors() : void

getDefaultFormatter()

getDefaultFormatter() : \Monolog\Formatter\FormatterInterface

{@inheritDoc}

Formatted output may contain some formatting markers to be transferred to console.log using the %c format.

Example of formatted string:

You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white}

Returns

\Monolog\Formatter\FormatterInterface —

registerShutdownFunction()

registerShutdownFunction() : void

Wrapper for register_shutdown_function to allow overriding

writeOutput()

writeOutput(string  $str) : void

Wrapper for echo to allow overriding

Parameters

string $str

getResponseFormat()

getResponseFormat() : string

Checks the format of the response

If Content-Type is set to application/javascript or text/javascript -> js If Content-Type is set to text/html, or is unset -> html If Content-Type is anything else -> unknown

Returns

string —

One of 'js', 'html' or 'unknown'

getResponseFormatFromContentType()

getResponseFormatFromContentType(string  $contentType) : string

Parameters

string $contentType

Returns

string —

One of 'js', 'html' or 'unknown'

generateScript()

generateScript() : string

Returns

string —

getConsoleMethodForLevel()

getConsoleMethodForLevel(int  $level) : string

Parameters

int $level

Returns

string —

handleStyles()

handleStyles(string  $formatted) : string[]

Parameters

string $formatted

Returns

string[] —

handleCustomStyles()

handleCustomStyles(string  $style, string  $string) : string

Parameters

string $style
string $string

Returns

string —

dump()

dump(string  $title, array  $dict) : array

Parameters

string $title
array $dict

Returns

array —

quote()

quote(string  $arg) : string

Parameters

string $arg

Returns

string —

call()

call(mixed  ...$args) : string

Parameters

mixed $args variadic

Returns

string —

call_array()

call_array(string  $method, array  $args) : string

Parameters

string $method
array $args

Returns

string —