访问日志策略增加只记录WAF相关访问日志选项

This commit is contained in:
刘祥超
2022-04-22 17:13:59 +08:00
parent fa30015ca5
commit 2aea527dff
11 changed files with 81 additions and 64 deletions

View File

@@ -12,8 +12,9 @@ import (
)
type BaseStorage struct {
isOk bool
version int
isOk bool
version int
firewallOnly bool
}
func (this *BaseStorage) SetVersion(version int) {
@@ -32,6 +33,10 @@ func (this *BaseStorage) SetOk(isOk bool) {
this.isOk = isOk
}
func (this *BaseStorage) SetFirewallOnly(firewallOnly bool) {
this.firewallOnly = firewallOnly
}
// Marshal 对日志进行编码
func (this *BaseStorage) Marshal(accessLog *pb.HTTPAccessLog) ([]byte, error) {
return json.Marshal(accessLog)