6 declare(strict_types=1);
14 use Psr\Log\LoggerInterface;
29 private $newRelicWrapper;
44 LoggerInterface $logger
47 $this->newRelicWrapper = $newRelicWrapper;
60 if (!$this->shouldSetAppName()) {
65 $this->newRelicWrapper->setAppName($this->appName($subject));
67 $this->logger->critical($e);
81 private function appName(
State $state): string
84 $current = $this->config->getNewRelicAppName();
86 return $current .
';' . $current .
'_' .
$code;
94 private function shouldSetAppName(): bool
97 $this->config->isSeparateApps() &&
98 $this->config->getNewRelicAppName() &&
99 $this->config->isNewRelicEnabled()
afterSetAreaCode(State $subject, $result)
__construct(Config $config, NewRelicWrapper $newRelicWrapper, LoggerInterface $logger)