fix accesslog and serialization

This commit is contained in:
yusing
2024-12-18 09:57:29 +08:00
parent 87279688e6
commit 57a7c04a4c
10 changed files with 99 additions and 68 deletions

View File

@@ -81,7 +81,7 @@ func TestAccessLoggerCombined(t *testing.T) {
func TestAccessLoggerRedactQuery(t *testing.T) {
config := DefaultConfig()
config.Format = FormatCommon
config.Fields.Query.DefaultMode = FieldModeRedact
config.Fields.Query.Default = FieldModeRedact
ExpectEqual(t, fmtLog(config),
fmt.Sprintf("%s %s - - [%s] \"%s %s %s\" %d %d",
host, remote, TestTimeNow, method, uriRedacted, proto, status, contentLength,