Skip to content

Commit 84d5223

Browse files
committed
Don't log DB connection if config 'logSql' => false
Fixes unil-lettres/dilps-tiresias#189
1 parent b8657dc commit 84d5223

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/DBAL/Logging/Driver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public function __construct(
2121

2222
public function connect(#[SensitiveParameter] array $params): DriverInterface\Connection
2323
{
24-
_log()->debug('Connecting to DB', $this->maskPassword($params));
24+
if ($this->logSql) {
25+
_log()->debug('Connecting to DB', $this->maskPassword($params));
26+
}
2527

2628
// Don't bother to wrap the connection if we will never log SQL queries to file...
2729
$connection = parent::connect($params);

0 commit comments

Comments
 (0)