diff --git a/middleware/access_log.go b/middleware/access_log.go index 129498f..6d89e43 100644 --- a/middleware/access_log.go +++ b/middleware/access_log.go @@ -32,6 +32,15 @@ func fillCfg(cfg *AccessConfig) { if nil == cfg.ExtraFieldList { cfg.ExtraFieldList = make([]string, 0) } + if nil == cfg.RequestHeaderList { + cfg.RequestHeaderList = make([]string, 0) + } + if nil == cfg.ResponseHeaderList { + cfg.ResponseHeaderList = make([]string, 0) + } + if nil == cfg.ExtraFieldList { + cfg.ExtraFieldList = make([]string, 0) + } cfg.ExtraFieldList = append(cfg.ExtraFieldList, define.RecordRequestDataField, define.RecordResponseDataField) }