From 9474d6d45ef5fac9e9ec6c0d405f16eadce2f630 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 26 Oct 2022 17:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E7=BE=A4=E5=85=A8=E5=B1=80=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E9=85=8D=E7=BD=AE=E4=B8=AD=E5=A2=9E=E5=8A=A0=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E8=AE=BF=E9=97=AE=E6=97=A5=E5=BF=97=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/global-server-config/index.go | 6 ++++++ .../settings/global-server-config/index.html | 21 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/internal/web/actions/default/clusters/cluster/settings/global-server-config/index.go b/internal/web/actions/default/clusters/cluster/settings/global-server-config/index.go index ce17dfe2..9b2ea85f 100644 --- a/internal/web/actions/default/clusters/cluster/settings/global-server-config/index.go +++ b/internal/web/actions/default/clusters/cluster/settings/global-server-config/index.go @@ -78,7 +78,10 @@ func (this *IndexAction) RunPost(params struct { HttpAllAllowNodeIP bool HttpAllDefaultDomain string + HttpAccessLogEnableRequestHeaders bool + HttpAccessLogEnableResponseHeaders bool HttpAccessLogCommonRequestHeadersOnly bool + HttpAccessLogEnableCookies bool LogRecordServerError bool @@ -125,7 +128,10 @@ func (this *IndexAction) RunPost(params struct { config.HTTPAll.AllowNodeIP = params.HttpAllAllowNodeIP config.HTTPAll.DefaultDomain = params.HttpAllDefaultDomain + config.HTTPAccessLog.EnableRequestHeaders = params.HttpAccessLogEnableRequestHeaders + config.HTTPAccessLog.EnableResponseHeaders = params.HttpAccessLogEnableResponseHeaders config.HTTPAccessLog.CommonRequestHeadersOnly = params.HttpAccessLogCommonRequestHeadersOnly + config.HTTPAccessLog.EnableCookies = params.HttpAccessLogEnableCookies config.Log.RecordServerError = params.LogRecordServerError diff --git a/web/views/@default/clusters/cluster/settings/global-server-config/index.html b/web/views/@default/clusters/cluster/settings/global-server-config/index.html index 41fa86c2..a368a80d 100644 --- a/web/views/@default/clusters/cluster/settings/global-server-config/index.html +++ b/web/views/@default/clusters/cluster/settings/global-server-config/index.html @@ -49,6 +49,13 @@

访问日志

+ + + + + + + + + + + +
记录请求Header + +

选中后,表示在访问日志中记录请求Header。

+
只记录通用请求
Header
@@ -56,6 +63,20 @@

选中后,表示访问日志中只记录通用的HTTP请求Header(比如User-Agent),其他自定义或非标准的(比如Test-Header)将不记录。

记录响应Header + +

选中后,表示在访问日志中记录响应Header。

+
记录Cookie + +

选中后,表示访问日志中记录Cookie内容。

+

运行日志