如果 nginx 记录了日志 程序却没日志 通常是什么问题引起的
同一时间点,nginx日志存在。source_ip, datetime, /path, status
。
程序里中间件记录 这是第一个中间件全局也只有这一个中间件
<?php
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class RequestLogger
{
public function handle($request, \Closure $next)
{
Log::info(vsprintf('%s %s %s',[
$request->getRealMethod(),
$request->fullUrl(),
$request->getClientIp()
]));
return $next($request);
}
}
nginx对应时间点有日志,程序日志没有其他时间点日志都存在
有可能是哪里出了问题
可能是这个中间件没有被调用吧