From 3dda5b19de38c8f72ed1e54d6180ca4e039043b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Diot?= Date: Wed, 24 Jan 2024 11:08:44 +0100 Subject: [PATCH] Update metrics logging This commit updates the metrics.lua file in the src/common/core/metrics directory. The changes include: - Replacing the 'date' field with the current system time using os.time() - Updating the 'code' field to 'status' to match the ngx.status value --- src/common/core/metrics/metrics.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/core/metrics/metrics.lua b/src/common/core/metrics/metrics.lua index 8e884d421..1588dc182 100644 --- a/src/common/core/metrics/metrics.lua +++ b/src/common/core/metrics/metrics.lua @@ -50,12 +50,12 @@ function metrics:log() end end local request = { - date = self.ctx.bw.local_time, + date = os.time(), ip = self.ctx.bw.remote_addr, country = country, method = self.ctx.bw.request_method, url = self.ctx.bw.request_uri, - code = ngx.status, + status = ngx.status, ["user-agent"] = self.ctx.bw.http_user_agent or "", reason = reason, data = data,