Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2527615
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
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
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jan 31, 4:17 AM (11 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
426147
Default Alt Text
(1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment