mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-24 10:39:03 +08:00
Fixes #3101: Improved handling of log target failures. It will now skip target and log reason instead of going into infinite cycle
This commit is contained in:
@@ -73,6 +73,7 @@ Yii Framework 2 Change Log
|
|||||||
- Enh #2942: Added truncate and truncateWord methods (Alex-Code, samdark)
|
- Enh #2942: Added truncate and truncateWord methods (Alex-Code, samdark)
|
||||||
- Enh #3008: Added `Html::errorSummary()` (qiangxue)
|
- Enh #3008: Added `Html::errorSummary()` (qiangxue)
|
||||||
- Enh #3088: The debug and gii modules will manage their own URL rules now (hiltonjanfield, qiangxue)
|
- Enh #3088: The debug and gii modules will manage their own URL rules now (hiltonjanfield, qiangxue)
|
||||||
|
- Enh #3101: Improved handling of log target failures. It will now skip target and log reason instead of going into infinite cycle (samdark)
|
||||||
- Enh #3103: debugger panel is now not displayed when printing a page (githubjeka)
|
- Enh #3103: debugger panel is now not displayed when printing a page (githubjeka)
|
||||||
- Enh #3108: Added `yii\debug\Module::enableDebugLogs` to disable logging debug logs by default (qiangxue)
|
- Enh #3108: Added `yii\debug\Module::enableDebugLogs` to disable logging debug logs by default (qiangxue)
|
||||||
- Enh #3132: `yii\rbac\PhpManager` now supports more compact data file format (qiangxue)
|
- Enh #3132: `yii\rbac\PhpManager` now supports more compact data file format (qiangxue)
|
||||||
|
|||||||
@@ -105,7 +105,13 @@ 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];
|
||||||
}
|
}
|
||||||
$this->export();
|
try {
|
||||||
|
$this->export();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->enabled = false;
|
||||||
|
\Yii::warning('Unable to send log via '. get_class($this) .': ' . $e->getMessage(), __METHOD__);
|
||||||
|
\Yii::getLogger()->flush(true);
|
||||||
|
}
|
||||||
$this->messages = [];
|
$this->messages = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user