Add logging filter token

The token is used to filter out request logs when the user agent matches a randomly generated string.
This commit is contained in:
Maximilian Paß
2024-01-24 12:43:27 +01:00
committed by Sebastian Serth
parent 221a6ff1b2
commit 57590457a8
5 changed files with 52 additions and 3 deletions

View File

@ -93,7 +93,11 @@ func HTTPLoggingMiddleware(next http.Handler) http.Handler {
"duration": latency,
"user_agent": RemoveNewlineSymbol(r.UserAgent()),
})
logEntry.Debug()
if r.UserAgent() == dto.UserAgentFiltered {
logEntry.Trace()
} else {
logEntry.Debug()
}
})
}