1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 09:06:10 +02:00

Merge branch '1.x'

This commit is contained in:
Jordi Boggiano
2016-05-20 19:40:36 +01:00
11 changed files with 223 additions and 37 deletions

View File

@@ -92,23 +92,27 @@ class NewRelicHandler extends AbstractProcessingHandler
newrelic_notice_error($record['message']);
}
foreach ($record['formatted']['context'] as $key => $parameter) {
if (is_array($parameter) && $this->explodeArrays) {
foreach ($parameter as $paramKey => $paramValue) {
$this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue);
if (isset($record['formatted']['context'])) {
foreach ($record['formatted']['context'] as $key => $parameter) {
if (is_array($parameter) && $this->explodeArrays) {
foreach ($parameter as $paramKey => $paramValue) {
$this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue);
}
} else {
$this->setNewRelicParameter('context_' . $key, $parameter);
}
} else {
$this->setNewRelicParameter('context_' . $key, $parameter);
}
}
foreach ($record['formatted']['extra'] as $key => $parameter) {
if (is_array($parameter) && $this->explodeArrays) {
foreach ($parameter as $paramKey => $paramValue) {
$this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue);
if (isset($record['formatted']['extra'])) {
foreach ($record['formatted']['extra'] as $key => $parameter) {
if (is_array($parameter) && $this->explodeArrays) {
foreach ($parameter as $paramKey => $paramValue) {
$this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue);
}
} else {
$this->setNewRelicParameter('extra_' . $key, $parameter);
}
} else {
$this->setNewRelicParameter('extra_' . $key, $parameter);
}
}
}