25 self::$appname =
null;
26 self::$customParameters = array();
27 self::$transactionName =
null;
49 $this->assertEquals(array(
'context_a' =>
'b'), self::$customParameters);
58 array(
'a' => array(
'key1' =>
'value1',
'key2' =>
'value2'))
61 array(
'context_a_key1' =>
'value1',
'context_a_key2' =>
'value2'),
62 self::$customParameters
69 $record[
'extra'] = array(
'c' =>
'd');
72 $handler->handle($record);
74 $this->assertEquals(array(
'extra_c' =>
'd'), self::$customParameters);
80 $record[
'extra'] = array(
'c' => array(
'key1' =>
'value1',
'key2' =>
'value2'));
83 $handler->handle($record);
86 array(
'extra_c_key1' =>
'value1',
'extra_c_key2' =>
'value2'),
87 self::$customParameters
94 $record[
'extra'] = array(
'c' =>
'd');
97 $handler->handle($record);
104 $this->assertEquals($expected, self::$customParameters);
112 $this->assertEquals(
null, self::$appname);
120 $this->assertEquals(
'myAppName', self::$appname);
128 $this->assertEquals(
'logAppName', self::$appname);
136 $this->assertEquals(
null, self::$transactionName);
144 $this->assertEquals(
'myTransaction', self::$transactionName);
150 $handler->handle($this->
getRecord(
Logger::ERROR,
'log message', array(
'transaction_name' =>
'logTransactName')));
152 $this->assertEquals(
'logTransactName', self::$transactionName);
testTheTransactionNameCanBeOverriddenFromEachLog()
testThehandlerCanHandleTheRecord()
testTheAppNameCanBeOverriddenFromEachLog()
testThehandlerCanAddExplodedContextParamsToTheNewRelicTrace()
testTheTransactionNameIsNullByDefault()
testThehandlerCanAddContextParamsToTheNewRelicTrace()
testThehandlerThrowsAnExceptionIfTheNRExtensionIsNotLoaded()
@expectedException Monolog\Handler\MissingExtensionException
testThehandlerCanAddExtraParamsToTheNewRelicTrace()
testTheTransactionNameCanBeInjectedFromTheConstructor()
testTheAppNameCanBeInjectedFromtheConstructor()
testThehandlerCanAddExplodedExtraParamsToTheNewRelicTrace()
testTheAppNameIsNullByDefault()
testThehandlerCanAddExtraContextAndParamsToTheNewRelicTrace()
Class to record a log on a NewRelic application.
isNewRelicEnabled()
Checks whether the NewRelic extension is enabled in the system.
isNewRelicEnabled()
Checks whether the NewRelic extension is enabled in the system.
const ERROR
Runtime errors.
const DEBUG
Detailed debug information.
getRecord($level=Logger::WARNING, $message='test', $context=array())
newrelic_set_appname($appname)
newrelic_add_custom_parameter($key, $value)
newrelic_name_transaction($transactionName)