74 protected function write(array $record)
86 unset($record[
'formatted'][
'context'][
'transaction_name']);
89 if (isset($record[
'context'][
'exception']) && ($record[
'context'][
'exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record[
'context'][
'exception'] instanceof \Throwable))) {
91 unset($record[
'formatted'][
'context'][
'exception']);
96 if (isset($record[
'formatted'][
'context']) && is_array($record[
'formatted'][
'context'])) {
97 foreach ($record[
'formatted'][
'context'] as
$key => $parameter) {
98 if (is_array($parameter) && $this->explodeArrays) {
99 foreach ($parameter as $paramKey => $paramValue) {
108 if (isset($record[
'formatted'][
'extra']) && is_array($record[
'formatted'][
'extra'])) {
109 foreach ($record[
'formatted'][
'extra'] as
$key => $parameter) {
110 if (is_array($parameter) && $this->explodeArrays) {
111 foreach ($parameter as $paramKey => $paramValue) {
128 return extension_loaded(
'newrelic');
157 if (isset(
$context[
'transaction_name'])) {
158 return $context[
'transaction_name'];
190 if (
null === $value || is_scalar($value)) {
An exception for terminatinating execution or to throw for unit testing.
Base Handler class providing the Handler structure.
Exception can be thrown if an extension for an handler is missing.
Class to record a log on a NewRelic application.
write(array $record)
Writes the record down to the log of the implementing handler.void
getTransactionName(array $context)
Returns the name of the current transaction.
setNewRelicAppName($appName)
Sets the NewRelic application that should receive this log.
getDefaultFormatter()
Gets the default formatter.FormatterInterface
setNewRelicParameter($key, $value)
setNewRelicTransactionName($transactionName)
Overwrites the name of the current transaction.
getAppName(array $context)
Returns the appname where this log should be sent.
isNewRelicEnabled()
Checks whether the NewRelic extension is enabled in the system.
__construct( $level=Logger::ERROR, $bubble=true, $appName=null, $explodeArrays=false, $transactionName=null)
const ERROR
Runtime errors.
newrelic_set_appname($appname)
newrelic_add_custom_parameter($key, $value)
newrelic_name_transaction($transactionName)