🎨 Lowercase key names in logfmt
This commit is contained in:
parent
aa710c0887
commit
4420ad2609
1 changed files with 3 additions and 3 deletions
|
@ -68,15 +68,15 @@ func LogFmtWithConfig(config LogFmtConfig) Interceptor {
|
|||
"user_agent", ctx.UserAgent(),
|
||||
)
|
||||
ctx.Request.Header.VisitAllInOrder(func(key, value []byte) {
|
||||
encoder.EncodeKeyval(strings.ReplaceAll("header_"+string(key), "-", "_"), value)
|
||||
encoder.EncodeKeyval(strings.ReplaceAll(strings.ToLower("header_"+string(key)), "-", "_"), value)
|
||||
})
|
||||
ctx.QueryArgs().VisitAll(func(key, value []byte) {
|
||||
encoder.EncodeKeyval(strings.ReplaceAll("query_"+string(key), "-", "_"), value)
|
||||
encoder.EncodeKeyval(strings.ReplaceAll(strings.ToLower("query_"+string(key)), "-", "_"), value)
|
||||
})
|
||||
|
||||
if form, err := ctx.MultipartForm(); err == nil {
|
||||
for k, v := range form.Value {
|
||||
encoder.EncodeKeyval(strings.ReplaceAll("form_"+k, "-", "_"), v)
|
||||
encoder.EncodeKeyval(strings.ReplaceAll(strings.ToLower("form_"+k), "-", "_"), v)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue