\Monolog\HandlerPHPConsoleHandler

Monolog handler for Google Chrome extension "PHP Console"

Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely

Usage:

  1. Install Google Chrome extension [now dead and removed from the chrome store]

  2. See overview https://github.com/barbushin/php-console#overview

  3. Install PHP Console library https://github.com/barbushin/php-console#installation

  4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png)

    $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler())); \Monolog\ErrorHandler::register($logger); echo $undefinedVar; $logger->debug('SELECT * FROM users', array('db', 'time' => 0.012)); PC::debug($_SERVER); // PHP Console debugger for any type of vars

Summary

Methods
Properties
Constants
handle()
reset()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
__construct()
isHandling()
setLevel()
getLevel()
setBubble()
getBubble()
handleBatch()
close()
__destruct()
__sleep()
getConnector()
getOptions()
No public properties found
No constants found
write()
processRecord()
resetProcessors()
getDefaultFormatter()
$processors
$formatter
$level
$bubble
N/A
initOptions()
initConnector()
handleDebugRecord()
handleExceptionRecord()
handleErrorRecord()
getRecordTags()
$options
$connector
N/A

Properties

$processors

$processors : callable[]

Type

callable[]

$formatter

$formatter : ?\Monolog\Formatter\FormatterInterface

Type

FormatterInterface

$level

$level : int

Type

int

$bubble

$bubble : bool

Type

bool

$options

$options : array<string,mixed>

Type

array

$connector

$connector : \PhpConsole\Connector

Type

\PhpConsole\Connector —

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(array<string,mixed>  $options = [], \PhpConsole\Connector|null  $connector = null, mixed  $level = Logger::DEBUG, bool  $bubble = true) : mixed

Parameters

array $options

See \Monolog\Handler\PHPConsoleHandler::$options for more details

\PhpConsole\Connector|null $connector

Instance of \PhpConsole\Connector class (optional)

mixed $level
bool $bubble

Throws

\RuntimeException

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

Closes the handler.

__destruct()

__destruct() : mixed

Returns

mixed —

__sleep()

__sleep() : mixed

Returns

mixed —

getConnector()

getConnector() : \PhpConsole\Connector

Returns

\PhpConsole\Connector —

getOptions()

getOptions() : array<string,mixed>

Returns

array

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}

Returns

\Monolog\Formatter\FormatterInterface —

initOptions()

initOptions(array<string,mixed>  $options) : array<string,mixed>

Parameters

array $options

Returns

array

initConnector()

initConnector(?\PhpConsole\Connector  $connector = null) : \PhpConsole\Connector

Parameters

?\PhpConsole\Connector $connector

Returns

\PhpConsole\Connector —

handleDebugRecord()

handleDebugRecord(array  $record) : void

Parameters

array $record

handleExceptionRecord()

handleExceptionRecord(array  $record) : void

Parameters

array $record

handleErrorRecord()

handleErrorRecord(array  $record) : void

Parameters

array $record

getRecordTags()

getRecordTags(array  $record) : string

Parameters

array $record

Returns

string —