Skip to content

Commit 3185c26

Browse files
committed
1 parent 0193317 commit 3185c26

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ClientSession.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,15 @@ public function getId(){
110110
*/
111111
public static function start($db, $sessionOptions = []){
112112
self::prepareOptions($sessionOptions);
113-
Yii::debug('Starting mongodb session ...', __METHOD__);
113+
if($db->enableProfiling)
114+
Yii::debug('Starting mongodb session ...', __METHOD__);
114115
$db->trigger(Connection::EVENT_START_SESSION);
115116
$newSession = new self([
116117
'db' => $db,
117118
'mongoSession' => $db->manager->startSession($sessionOptions),
118119
]);
119-
Yii::debug('MongoDB session started.', __METHOD__);
120+
if($db->enableProfiling)
121+
Yii::debug('MongoDB session started.', __METHOD__);
120122
return $newSession;
121123
}
122124

0 commit comments

Comments
 (0)