From 66062c42b7ad79bb0991f9aaacb3bed82f88b0a8 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 20 Apr 2022 12:21:45 +1000 Subject: [PATCH] fixes for query logging --- app/Http/Middleware/QueryLogging.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/Http/Middleware/QueryLogging.php b/app/Http/Middleware/QueryLogging.php index caa5d09491..94ba71086a 100644 --- a/app/Http/Middleware/QueryLogging.php +++ b/app/Http/Middleware/QueryLogging.php @@ -35,9 +35,9 @@ class QueryLogging { // Enable query logging for development - // if (!Ninja::isHosted() || !config('beacon.enabled')) { - // return $next($request); - // } + if (!Ninja::isHosted() || !config('beacon.enabled')) { + return $next($request); + } $timeStart = microtime(true); DB::enableQueryLog(); @@ -52,12 +52,11 @@ class QueryLogging $time = $timeEnd - $timeStart; // info("Query count = {$count}"); - $url = urldecode($request->url()); - $method = $request->method(); - // if($count > 175){ - nlog("Query count = {$count} - {$method} - {$url} "); - // nlog($queries); - // } + + if($count > 175){ + nlog("Query count = {$count}"); + nlog($queries); + } $ip = '';