\Monolog\HandlerRollbarHandler

Sends errors to Rollbar

If the context data contains a payload key, that is used as an array of payload options to RollbarNotifier's report_message/report_exception methods.

Rollbar's context info will contain the context + extra keys from the log record merged, and then on top of that a few keys:

  • level (rollbar level name)
  • monolog_level (monolog level name, raw level, as rollbar only has 5 but monolog 8)
  • channel
  • datetime (unix timestamp)

Summary

Methods
Properties
Constants
handle()
__construct()
isHandling()
handleBatch()
close()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
setLevel()
getLevel()
setBubble()
getBubble()
__destruct()
flush()
No public properties found
No constants found
write()
processRecord()
getDefaultFormatter()
$level
$bubble
$formatter
$processors
$rollbarNotifier
$levelMap
$initialized
N/A
No private methods found
$hasRecords
N/A

Properties

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$rollbarNotifier

$rollbarNotifier : \RollbarNotifier

Rollbar notifier

Type

\RollbarNotifier

$levelMap

$levelMap : 

Type

$initialized

$initialized : 

Type

$hasRecords

$hasRecords : boolean

Records whether any log records have been added since the last flush of the rollbar notifier

Type

boolean

Methods

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

__construct()

__construct(\RollbarNotifier  $rollbarNotifier, integer  $level = \Monolog\Logger::ERROR, boolean  $bubble = true) 

Parameters

\RollbarNotifier $rollbarNotifier

RollbarNotifier object constructed with valid token

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

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

flush()

flush() 

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