add time
This commit is contained in:
parent
1bf977af39
commit
2424ffcabb
|
@ -9,6 +9,9 @@ use Monolog\Logger;
|
||||||
|
|
||||||
class QueryListener
|
class QueryListener
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the event listener.
|
* Create the event listener.
|
||||||
*
|
*
|
||||||
|
@ -34,7 +37,7 @@ class QueryListener
|
||||||
if (env('APP_DEBUG')) {
|
if (env('APP_DEBUG')) {
|
||||||
$sql = str_replace("?", "'%s'", $event->sql);
|
$sql = str_replace("?", "'%s'", $event->sql);
|
||||||
$log = vsprintf($sql, $event->bindings);
|
$log = vsprintf($sql, $event->bindings);
|
||||||
$this->logger->info($log);
|
$this->logger->info($log, ['conn' => $event->connectionName, 'time' => $event->time]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user