nicolas-cajelli / slim-newrelic
0.1.0
2017-08-24 15:37 UTC
Requires
- php: >=7.0
- nicolas-cajelli/slim-errorhandler: >=0.1.1
- slim/slim: >=3.7
This package is not auto-updated.
Last update: 2025-04-09 00:58:11 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; };