nicolas-cajelli / slim-newrelic
Installs: 72
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/nicolas-cajelli/slim-newrelic
Requires
- php: >=7.0
- nicolas-cajelli/slim-errorhandler: >=0.1.1
- slim/slim: >=3.7
This package is not auto-updated.
Last update: 2025-10-08 03:08:38 UTC
README
Newrelic implementation for slim framework
Install
composer require nicolas-cajelli/slim-newrelic
Setup
$config['responseHandlers'] = function(ContainerInterface $c) { return [ $c->get(BadRequestJsonResponseHandler::class), $c->get(NewrelicResponseHandler::class), ]; }; $app->add(NewRelicTransactionMiddleware::class);
Configure (optional)
If you want to define your own appName + licenseKey:
$config['settings'] = [ // ... 'newRelic' => [ 'licenseKey' => 'your-license', 'appName' => 'your-app' ] // ... ];
Advanced
- Provide your own implementations for naming and/or decorators
$config[NewRelicTransactionMiddleware::class] = function(ContainerInterface $c) { $middleware = new NewRelicTransactionMiddleware($c); $middleware->addTransactionDecorator(CustomDecorator::class); $middleware->setTransactionNaming(CustomNamingPolicy::class); return $middleware; };