Skip to content

Commit

Permalink
Dodge exit from application
Browse files Browse the repository at this point in the history
  • Loading branch information
jjsaunier committed Mar 3, 2016
1 parent d132bbf commit b032850
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/KernelStack/NewrelicMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Pyrite\KernelStack;

use Pyrite\Kernel\PyriteKernel;
use Pyrite\Logger\LoggerFactory;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
Expand All @@ -25,21 +25,21 @@ class NewrelicMiddleware implements HttpKernelInterface, TerminableInterface
*/
protected $newRelic;

/** @var PyriteKernel */
protected $pyrite;
/** @var LoggerFactory */
protected $loggerFactory;

/**
* NewrelicMiddleware constructor.
*
* @param HttpKernelInterface $app
* @param string $applicationName
* @param PyriteKernel $pyrite
* @param string $applicationName
* @param LoggerFactory $loggerFactory
*/
public function __construct(HttpKernelInterface $app, $applicationName, PyriteKernel $pyrite)
public function __construct(HttpKernelInterface $app, $applicationName, LoggerFactory $loggerFactory)
{
$this->app = $app;
$this->applicationName = $applicationName;
$this->pyrite = $pyrite;
$this->loggerFactory = $loggerFactory;

$this->newRelic = new \Intouch\Newrelic\Newrelic(false);
$this->newRelic->setAppName($applicationName);
Expand All @@ -63,7 +63,7 @@ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch =
return $this->app->handle($request, $type, $catch);
}

foreach($this->pyrite->getContainer()->get('LoggerFactory')->getTags() as $name => $value){
foreach($this->loggerFactory->getTags() as $name => $value){
$this->newRelic->addCustomParameter($name, $value);
}

Expand Down

0 comments on commit b032850

Please sign in to comment.