实现请求日志写入

This commit is contained in:
刘祥超
2020-10-10 11:49:30 +08:00
parent f4ff9c430c
commit 22a7e9c2dc
7 changed files with 1224 additions and 1 deletions

View File

@@ -1,5 +1,8 @@
package serverconfigs
// 默认的访问日志配置
var DefaultHTTPAccessLogRef = NewHTTPAccessLogRef()
// 代理访问日志配置
type HTTPAccessLogRef struct {
IsPrior bool `yaml:"isPrior" json:"isPrior"` // 是否覆盖
@@ -73,3 +76,13 @@ func (this *HTTPAccessLogRef) ContainsStoragePolicy(storagePolicyId int64) bool
}
return false
}
// 检查是否包含某个Field
func (this *HTTPAccessLogRef) ContainsField(field int) bool {
for _, f := range this.Fields {
if f == field {
return true
}
}
return false
}