From 76213e3bd809ee4a4e756dd95b5bc7f76d47beb2 Mon Sep 17 00:00:00 2001 From: Lau Josefsen Date: Tue, 30 Apr 2024 13:29:22 +0200 Subject: [PATCH] Use framework client ip for context --- src/FilebeatLogging/RequestProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FilebeatLogging/RequestProcessor.php b/src/FilebeatLogging/RequestProcessor.php index ffcf515..aae1b16 100644 --- a/src/FilebeatLogging/RequestProcessor.php +++ b/src/FilebeatLogging/RequestProcessor.php @@ -38,7 +38,7 @@ public function __invoke(LogRecord $record): LogRecord private static function clientExtras(Request $request): array { return [ - 'ip' => $request->header('CF-Connecting-IP') ?? $request->getClientIp(), + 'ip' => $request->getClientIp(), 'address' => $request->header('X-Forwarded-For'), 'geo' => [ 'country_iso_code' => $request->header('CF-IPCountry'),