1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- declare (strict_types=1);
- namespace app\common\middleware;
- use app\common\model\AdminLog;
- use app\Request;
- use Closure;
- use think\facade\Log;
- class WriteLog
- {
-
- public function handle(Request $request, Closure $next): mixed
- {
- $response = $next($request);
-
- Log::record("===============" . getNow() . "全局日志记录===============", "debug");
- Log::record("request:" . $request->url(true), "debug");
- Log::record('REFERER ' . (array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : ""));
- Log::record('GET ' . json_encode($_GET, JSON_UNESCAPED_UNICODE));
- Log::record('POST ' . json_encode($_POST, JSON_UNESCAPED_UNICODE));
- Log::record('cookie ' . json_encode($_COOKIE, JSON_UNESCAPED_UNICODE));
- Log::record('param ' . json_encode(input('param.'), JSON_UNESCAPED_UNICODE));
- return $response;
- }
- }
|