Merge branch 'fix/sql_function' into 'master'
兼容sql function See merge request composer/php-sql-logger!1
This commit is contained in:
commit
74b4bdaf99
|
@ -35,7 +35,8 @@ class QueryListener
|
||||||
{
|
{
|
||||||
if (env('APP_DEBUG')) {
|
if (env('APP_DEBUG')) {
|
||||||
$sql = str_replace("?", "'%s'", $event->sql);
|
$sql = str_replace("?", "'%s'", $event->sql);
|
||||||
$this->logger->debug(vsprintf($sql, $event->bindings), ['conn' => $event->connectionName, 'time' => $event->time.'ms']);
|
$log = $event->bindings ? vsprintf($sql, $event->bindings) : $sql;
|
||||||
|
$this->logger->debug($log, ['conn' => $event->connectionName, 'time' => $event->time.'ms']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user