\Monolog\HandlerRollbarHandler

Sends errors to Rollbar

If the context data contains a payload key, that is used as an array of payload options to RollbarLogger's log method.

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()
reset()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
__construct()
isHandling()
setLevel()
getLevel()
setBubble()
getBubble()
handleBatch()
close()
__destruct()
__sleep()
flush()
No public properties found
No constants found
write()
processRecord()
resetProcessors()
getDefaultFormatter()
$processors
$formatter
$level
$bubble
$rollbarLogger
$levelMap
$initialized
N/A
No private methods found
$hasRecords
N/A

Properties

$processors

$processors : array<mixed,callable>

Type

array<mixed,callable>

$formatter

$formatter : \Monolog\Handler\?FormatterInterface

Type

\Monolog\Handler\?FormatterInterface

$level

$level : 

Type

$bubble

$bubble : 

Type

$rollbarLogger

$rollbarLogger : \Rollbar\RollbarLogger

Type

\Rollbar\RollbarLogger

$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

reset()

reset() : void

pushProcessor()

pushProcessor(callable  $callback) 

{@inheritdoc}

Parameters

callable $callback

popProcessor()

popProcessor() 

{@inheritdoc}

getFormatter()

getFormatter() 

{@inheritdoc}

__construct()

__construct(\Rollbar\RollbarLogger  $rollbarLogger, string|integer  $level = \Monolog\Logger::ERROR, boolean  $bubble = true) 

Parameters

\Rollbar\RollbarLogger $rollbarLogger

RollbarLogger object constructed with valid token

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

{@inheritdoc}

Parameters

array $record

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.

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}

__destruct()

__destruct() 

__sleep()

__sleep() 

flush()

flush() 

write()

write(array  $record) 

Writes the record down to the log of the implementing handler

Parameters

array $record

processRecord()

processRecord(array  $record) 

Processes a record.

Parameters

array $record

resetProcessors()

resetProcessors() 

getDefaultFormatter()

getDefaultFormatter() 

Gets the default formatter.

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