We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d35d140 + 171773b commit 4d34147Copy full SHA for 4d34147
Newrelic.php
@@ -70,10 +70,15 @@ public function init()
70
{
71
parent::init();
72
73
- if ($this->enabled && Agent::isLoaded()) {
74
- $this->name = $this->name ? $this->name : \Yii::$app->name;
75
- $this->agent = new Agent();
76
- $this->agent->setAppname($this->name, $this->licence);
+ if ($this->enabled) {
+ if (Agent::isLoaded()) {
+ $this->name = $this->name ? $this->name : \Yii::$app->name;
+ $this->agent = new Agent();
77
+ $this->agent->setAppname($this->name, $this->licence);
78
+ } else {
79
+ $this->enabled = false;
80
+ \Yii::$app->getLog()->getLogger()->log('Newrelic extension is not loaded', \yii\log\Logger::LEVEL_ERROR);
81
+ }
82
}
83
84
0 commit comments