This is an automated email from the ASF dual-hosted git repository.
baoyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new edf037548 fix: use apisix_request_id only in http subsystem log format
(#13006)
edf037548 is described below
commit edf03754870323183a2abb91869c63f84b0fc98d
Author: Shreemaan Abhishek <[email protected]>
AuthorDate: Fri Feb 13 07:29:11 2026 +0545
fix: use apisix_request_id only in http subsystem log format (#13006)
---
apisix/cli/config.lua | 4 ++--
t/cli/test_access_log.sh | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/apisix/cli/config.lua b/apisix/cli/config.lua
index 13359fa81..ee6a68825 100644
--- a/apisix/cli/config.lua
+++ b/apisix/cli/config.lua
@@ -111,7 +111,7 @@ local _M = {
enable_access_log = false,
access_log = "logs/access_stream.log",
-- luacheck: push max code line length 300
- access_log_format = "$remote_addr [$time_local] $protocol $status
$bytes_sent $bytes_received $session_time $apisix_request_id",
+ access_log_format = "$remote_addr [$time_local] $protocol $status
$bytes_sent $bytes_received $session_time",
-- luacheck: pop
access_log_format_escape = "default",
lua_shared_dict = {
@@ -136,7 +136,7 @@ local _M = {
access_log_buffer = 16384,
-- luacheck: push max code line length 300
access_log_format =
- '$remote_addr - $remote_user [$time_local] $http_host "$request" $status
$body_bytes_sent $request_time "$http_referer" "$http_user_agent"
$upstream_addr $upstream_status $upstream_response_time
"$upstream_scheme://$upstream_host$upstream_uri"',
+ '$remote_addr - $remote_user [$time_local] $http_host "$request" $status
$body_bytes_sent $request_time "$http_referer" "$http_user_agent"
$upstream_addr $upstream_status $upstream_response_time
"$upstream_scheme://$upstream_host$upstream_uri" "$apisix_request_id"',
-- luacheck: pop
access_log_format_escape = "default",
keepalive_timeout = "60s",
diff --git a/t/cli/test_access_log.sh b/t/cli/test_access_log.sh
index 678e3e431..180f9ff01 100755
--- a/t/cli/test_access_log.sh
+++ b/t/cli/test_access_log.sh
@@ -158,7 +158,7 @@ curl http://127.0.0.1:9080/hello2
sleep 4
tail -n 1 logs/access.log > output.log
-if [ `grep -E '[0-9|.]+ - - \[[^]]+\] [0-9|.:]+ "[^"]+" [0-9]+ [0-9]+ [0|.]+
"-" "[^"]+" - - - "[^"]+" ".{36}"' output.log` -eq '0' ]; then
+if [ `grep -E '"[0-9a-zA-Z]{32}"$' output.log` -eq '0' ]; then
echo "failed: access log don't match default log format"
exit 1
fi