Fix #16671: Logging in Connection::open() was not respecting Connection::$enableLogging

This commit is contained in:
Alexander Makarov
2019-09-17 17:51:50 +03:00
parent 23202244b4
commit 37d62c2509
2 changed files with 5 additions and 1 deletions

View File

@ -613,7 +613,10 @@ class Connection extends Component
$token = 'Opening DB connection: ' . $this->dsn;
$enableProfiling = $this->enableProfiling;
try {
Yii::info($token, __METHOD__);
if ($this->enableLogging) {
Yii::info($token, __METHOD__);
}
if ($enableProfiling) {
Yii::beginProfile($token, __METHOD__);
}