\Monolog\HandlerStubNewRelicHandlerWithoutExtension

Class to record a log on a NewRelic application.

Enabling New Relic High Security mode may prevent capture of useful information.

Summary

Methods
Properties
Constants
__construct()
handle()
isHandling()
handleBatch()
close()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
setLevel()
getLevel()
setBubble()
getBubble()
__destruct()
No public properties found
No constants found
write()
isNewRelicEnabled()
getAppName()
getTransactionName()
setNewRelicAppName()
setNewRelicTransactionName()
setNewRelicParameter()
getDefaultFormatter()
processRecord()
$appName
$transactionName
$explodeArrays
$level
$bubble
$formatter
$processors
N/A
No private methods found
No private properties found
N/A

Properties

$appName

$appName : string

Name of the New Relic application that will receive logs from this handler.

Type

string

$transactionName

$transactionName : string

Name of the current transaction

Type

string

$explodeArrays

$explodeArrays : boolean

Some context and extra data is passed into the handler as arrays of values. Do we send them as is (useful if we are using the API), or explode them for display on the NewRelic RPM website?

Type

boolean

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

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

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

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

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

write()

write(array  $record) : void

Writes the record down to the log of the implementing handler

Parameters

array $record

isNewRelicEnabled()

isNewRelicEnabled() : boolean

Checks whether the NewRelic extension is enabled in the system.

Returns

boolean

getAppName()

getAppName(array  $context) : null|string

Returns the appname where this log should be sent. Each log can override the default appname, set in this handler's constructor, by providing the appname in it's context.

Parameters

array $context

Returns

null|string

getTransactionName()

getTransactionName(array  $context) : null|string

Returns the name of the current transaction. Each log can override the default transaction name, set in this handler's constructor, by providing the transaction_name in it's context

Parameters

array $context

Returns

null|string

setNewRelicAppName()

setNewRelicAppName(string  $appName) 

Sets the NewRelic application that should receive this log.

Parameters

string $appName

setNewRelicTransactionName()

setNewRelicTransactionName(string  $transactionName) 

Overwrites the name of the current transaction

Parameters

string $transactionName

setNewRelicParameter()

setNewRelicParameter(string  $key, mixed  $value) 

Parameters

string $key
mixed $value

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array