{"record":{"id":"d93f8bd5658907ee","repo":"Seldaek/monolog","slug":"the-newrelic-php-extension-is-required-to-use-the","errorCode":null,"errorMessage":"The newrelic PHP extension is required to use the NewRelicHandler","messagePattern":"The newrelic PHP extension is required to use the NewRelicHandler","errorType":"exception","errorClass":"MissingExtensionException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/NewRelicHandler.php","lineNumber":63,"sourceCode":"         * (useful if we are using the API), or explode them for display on the NewRelic RPM website?\n         */\n        protected bool $explodeArrays = false,\n\n        /**\n         * Name of the current transaction\n         */\n        protected string|null $transactionName = null\n    ) {\n        parent::__construct($level, $bubble);\n    }\n\n    /**\n     * @inheritDoc\n     */\n    protected function write(LogRecord $record): void\n    {\n        if (!$this->isNewRelicEnabled()) {\n            throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler');\n        }\n\n        if (null !== ($appName = $this->getAppName($record->context))) {\n            $this->setNewRelicAppName($appName);\n        }\n\n        if (null !== ($transactionName = $this->getTransactionName($record->context))) {\n            $this->setNewRelicTransactionName($transactionName);\n            unset($record->formatted['context']['transaction_name']);\n        }\n\n        if (isset($record->context['exception']) && $record->context['exception'] instanceof \\Throwable) {\n            newrelic_notice_error($record->message, $record->context['exception']);\n            unset($record->formatted['context']['exception']);\n        } else {\n            newrelic_notice_error($record->message);\n        }\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/NewRelicHandler.php#L45-L81","documentation":"Error \"The newrelic PHP extension is required to use the NewRelicHandler\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/NewRelicHandler.php:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}