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:

committed by
Sebastian Serth

parent
221a6ff1b2
commit
57590457a8
@ -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()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user