From 2424ffcabbb8a3757f507a1b9ed0ae9c38ee4b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=80=99=E5=AD=A6=E6=9D=B0?= Date: Wed, 2 May 2018 20:55:02 +0800 Subject: [PATCH] add time --- src/Listeners/QueryListener.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Listeners/QueryListener.php b/src/Listeners/QueryListener.php index f83f7b4..4fbf625 100644 --- a/src/Listeners/QueryListener.php +++ b/src/Listeners/QueryListener.php @@ -9,6 +9,9 @@ use Monolog\Logger; class QueryListener { + + protected $logger; + /** * Create the event listener. * @@ -34,7 +37,7 @@ class QueryListener if (env('APP_DEBUG')) { $sql = str_replace("?", "'%s'", $event->sql); $log = vsprintf($sql, $event->bindings); - $this->logger->info($log); + $this->logger->info($log, ['conn' => $event->connectionName, 'time' => $event->time]); } }