Page MenuHomePhorge

No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/src/app/Http/Middleware/RequestLogger.php b/src/app/Http/Middleware/RequestLogger.php
index 37904d61..087f8996 100644
--- a/src/app/Http/Middleware/RequestLogger.php
+++ b/src/app/Http/Middleware/RequestLogger.php
@@ -1,38 +1,38 @@
<?php
namespace App\Http\Middleware;
use Closure;
class RequestLogger
{
private static $start;
public function handle($request, Closure $next)
{
// FIXME: This is not really a request start, but we can't
// use LARAVEL_START constant when working with swoole
self::$start = microtime(true);
return $next($request);
}
public function terminate($request, $response)
{
- if (\App::environment('local')) {
+ if (\App::environment(['local', 'testing'])) {
$url = $request->fullUrl();
$method = $request->getMethod();
$mem = round(memory_get_peak_usage() / 1024 / 1024, 1);
$time = microtime(true) - self::$start;
\Log::debug(sprintf("C: %s %s [%sM]: %.4f sec.", $method, $url, $mem, $time));
} else {
$threshold = \config('logging.slow_log');
if ($threshold && ($time = microtime(true) - self::$start) > $threshold) {
$url = $request->fullUrl();
$method = $request->getMethod();
\Log::warning(sprintf("[STATS] %s %s: %.4f sec.", $method, $url, $time));
}
}
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jan 31, 4:17 AM (6 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
426147
Default Alt Text
(1 KB)

Event Timeline