mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Log exact IP if reported by cloudflare
This commit is contained in:
parent
a3a406b122
commit
8f78f93537
@ -55,8 +55,15 @@ class QueryLogging
|
||||
//nlog($request->method().' - '.urldecode($request->url()).": $count queries - ".$time);
|
||||
// if($count > 50)
|
||||
//nlog($queries);
|
||||
$ip = '';
|
||||
|
||||
LightLogs::create(new DbQuery($request->method(), urldecode($request->url()), $count, $time, request()->ip()))
|
||||
if(request()->header('Cf-Connecting-Ip'))
|
||||
$ip = request()->header('Cf-Connecting-Ip');
|
||||
else{
|
||||
$ip = request()->ip();
|
||||
}
|
||||
|
||||
LightLogs::create(new DbQuery($request->method(), urldecode($request->url()), $count, $time, $ip))
|
||||
->batch();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user