集群全局服务配置中增加多个访问日志相关选项

This commit is contained in:
GoEdgeLab
2022-10-26 17:49:45 +08:00
parent 70ae469620
commit 4ea47057bd

View File

@@ -4,6 +4,9 @@ package serverconfigs
func DefaultGlobalServerConfig() *GlobalServerConfig {
var config = &GlobalServerConfig{}
config.HTTPAccessLog.EnableRequestHeaders = true
config.HTTPAccessLog.EnableResponseHeaders = true
config.HTTPAccessLog.EnableCookies = true
config.Log.RecordServerError = false
return config
}
@@ -19,7 +22,10 @@ type GlobalServerConfig struct {
} `yaml:"httpAll" json:"httpAll"`
HTTPAccessLog struct {
EnableRequestHeaders bool `yaml:"enableRequestHeaders" json:"enableRequestHeaders"` // 记录请求Header
CommonRequestHeadersOnly bool `yaml:"commonRequestHeadersOnly" json:"commonRequestHeadersOnly"` // 只保留通用Header
EnableResponseHeaders bool `yaml:"enableResponseHeaders" json:"enableResponseHeaders"` // 记录响应Header
EnableCookies bool `yaml:"enableCookies" json:"enableCookies"` // 记录Cookie
} `yaml:"httpAccessLog" json:"httpAccessLog"` // 访问日志配置
Log struct {