1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-02 03:20:34 +02:00

Logging fixes

This commit is contained in:
binwiederhier 2023-02-25 15:31:12 -05:00
parent 0606fbe60a
commit f7f343fe55
3 changed files with 13 additions and 5 deletions
server

View file

@ -30,6 +30,10 @@ const (
tagMatrix = "matrix"
)
var (
normalErrorCodes = []int{http.StatusNotFound, http.StatusBadRequest, http.StatusTooManyRequests, http.StatusUnauthorized, http.StatusInsufficientStorage}
)
// logr creates a new log event with HTTP request fields
func logr(r *http.Request) *log.Event {
return log.Tag(tagHTTP).Fields(httpContext(r)) // Tag may be overwritten