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

NewRelic handler: added the app name

This commit is contained in:
odino
2013-08-26 12:04:22 +04:00
parent 7a8844d4db
commit db3df1a1fa
2 changed files with 15 additions and 0 deletions

View File

@@ -37,6 +37,10 @@ class NewRelicHandler extends AbstractProcessingHandler
throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler');
}
if (isset($record['context']['appname'])) {
newrelic_set_appname($record['context']['appname']);
}
if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
newrelic_notice_error($record['message'], $record['context']['exception']);
unset($record['context']['exception']);