From f29577713bb1381330242be2f69aeebfc8b333d6 Mon Sep 17 00:00:00 2001 From: Lau Ernebjerg Josefsen <44977457+LauJosefsen@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:31:04 +0200 Subject: [PATCH] Use framework client ip for context (#29) --- 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'),