\Monolog\HandlerRavenHandler

Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server using raven-php (https://github.com/getsentry/raven-php)

Classes extending it should (in most cases) only implement write($record)

Summary

Methods
Properties
Constants
handle()
__construct()
isHandling()
handleBatch()
close()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
setLevel()
getLevel()
setBubble()
getBubble()
__destruct()
setBatchFormatter()
getBatchFormatter()
setRelease()
No public properties found
No constants found
write()
processRecord()
getDefaultFormatter()
getDefaultBatchFormatter()
getExtraParameters()
$level
$bubble
$formatter
$processors
$ravenClient
$batchFormatter
N/A
No private methods found
$logLevels
$release
N/A

Properties

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$ravenClient

$ravenClient : \Raven_Client

Type

\Raven_Client — the client object that sends the message to the server

$batchFormatter

$batchFormatter : \Monolog\Formatter\LineFormatter

Type

\Monolog\Formatter\LineFormatter — The formatter to use for the logs generated via handleBatch()

$logLevels

$logLevels : 

Translates Monolog log levels to Raven log levels.

Type

$release

$release : string

Type

string — should represent the current version of the calling software. Can be any string (git commit, version number)

Methods

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

__construct()

__construct(\Raven_Client  $ravenClient, integer  $level = \Monolog\Logger::DEBUG, Boolean  $bubble = true) 

Parameters

\Raven_Client $ravenClient
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) 

{@inheritdoc}

Parameters

array $records

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

setBatchFormatter()

setBatchFormatter(\Monolog\Formatter\FormatterInterface  $formatter) 

Sets the formatter for the logs generated by handleBatch().

Parameters

\Monolog\Formatter\FormatterInterface $formatter

getBatchFormatter()

getBatchFormatter() : \Monolog\Formatter\FormatterInterface

Gets the formatter for the logs generated by handleBatch().

Returns

\Monolog\Formatter\FormatterInterface

setRelease()

setRelease(string  $value) : self

Parameters

string $value

Returns

self

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

getDefaultFormatter()

getDefaultFormatter() 

{@inheritDoc}

getDefaultBatchFormatter()

getDefaultBatchFormatter() : \Monolog\Formatter\FormatterInterface

Gets the default formatter for the logs generated by handleBatch().

Returns

\Monolog\Formatter\FormatterInterface

getExtraParameters()

getExtraParameters() : array

Gets extra parameters supported by Raven that can be found in "extra" and "context"

Returns

array