Constants

VERSION

VERSION = '4.0'

Version of the extension

HEADER_NAME

HEADER_NAME = 'X-ChromeLogger-Data'

Header name

USER_AGENT_REGEX

USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}'

Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+)

Properties

$initialized

$initialized : 

Type

$overflowed

$overflowed : Boolean

Tracks whether we sent too much data

Chrome limits the headers to 256KB, so when we sent 240KB we stop sending

Type

Boolean

$json

$json : 

Type

$sendHeaders

$sendHeaders : 

Type

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$headers

$headers : 

Type

Methods

__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

handleBatch()

handleBatch(array  $records) 

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

__get()

__get(  $property) 

BC getter for the sendHeaders property that has been made static

Parameters

$property

__set()

__set(  $property,   $value) 

BC setter for the sendHeaders property that has been made static

Parameters

$property
$value

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

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

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

reset()

reset() 

getHeaders()

getHeaders() 

write()

write(array  $record) : void

Writes the record down to the log of the implementing handler

Parameters

array $record

send()

send() 

Sends the log header

sendHeader()

sendHeader(string  $header, string  $content) 

Send header string to the client

Parameters

string $header
string $content

headersAccepted()

headersAccepted() : Boolean

Verifies if the headers are accepted by the current user agent

Returns

Boolean

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array