mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-25 03:01:21 +08:00
@@ -62,6 +62,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #3989: Fixed yii\log\FileTarget::$rotateByCopy to avoid any rename (cebe)
|
||||
- Bug #3996: Traversing `Yii::$app->session` may cause a PHP error (qiangxue)
|
||||
- Bug #4020: OCI column detection did not work so gii and other things failed (Sanya1991)
|
||||
- Bug #4123: Trace level in logger had no effect in Targets, traces where not logged (cebe)
|
||||
- Bug #4127: `CaptchaValidator` clientside error message wasn't formed properly (samdark)
|
||||
- Bug #4162: Fixed bug where schema name was not used in ’SHOW CREATE TABLE’ query in `yii\db\mysql\Schema` (stevekr)
|
||||
- Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark)
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace yii\log;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Component;
|
||||
use yii\base\ErrorHandler;
|
||||
|
||||
/**
|
||||
* Dispatcher manages a set of [[Target|log targets]].
|
||||
@@ -183,7 +184,7 @@ class Dispatcher extends Component
|
||||
} catch (\Exception $e) {
|
||||
$target->enabled = false;
|
||||
$targetErrors[] = [
|
||||
'Unable to send log via '. get_class($target) .': ' . $e->getMessage(),
|
||||
'Unable to send log via ' . get_class($target) . ': ' . ErrorHandler::convertExceptionToString($e),
|
||||
Logger::LEVEL_WARNING,
|
||||
__METHOD__,
|
||||
microtime(true),
|
||||
|
||||
@@ -235,9 +235,16 @@ abstract class Target extends Component
|
||||
if (!is_string($text)) {
|
||||
$text = VarDumper::export($text);
|
||||
}
|
||||
$traces = [];
|
||||
if (isset($message[4])) {
|
||||
foreach($message[4] as $trace) {
|
||||
$traces[] = "in {$trace['file']}:{$trace['line']}";
|
||||
}
|
||||
}
|
||||
|
||||
$prefix = $this->getMessagePrefix($message);
|
||||
return date('Y-m-d H:i:s', $timestamp) . " {$prefix}[$level][$category] $text";
|
||||
return date('Y-m-d H:i:s', $timestamp) . " {$prefix}[$level][$category] $text"
|
||||
. (empty($traces) ? '' : "\n " . implode("\n ", $traces));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user