Browse Source

Avoid endless loop when exporting logs

fixes #4470
tags/2.0.0-rc
Carsten Brandt 10 years ago
parent
commit
31a56b59b0
  1. 5
      framework/log/Target.php

5
framework/log/Target.php

@ -105,7 +105,12 @@ abstract class Target extends Component
if (($context = $this->getContextMessage()) !== '') { if (($context = $this->getContextMessage()) !== '') {
$this->messages[] = [$context, Logger::LEVEL_INFO, 'application', YII_BEGIN_TIME]; $this->messages[] = [$context, Logger::LEVEL_INFO, 'application', YII_BEGIN_TIME];
} }
// set exportInterval to 0 to avoid triggering export again while exporting
$oldExportInterval = $this->exportInterval;
$this->exportInterval = 0;
$this->export(); $this->export();
$this->exportInterval = $oldExportInterval;
$this->messages = []; $this->messages = [];
} }
} }

Loading…
Cancel
Save