Skip to content

Commit cc3346b

Browse files
committed
change: declutter logs
1 parent ca27141 commit cc3346b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ version: 0.1.13
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "18663188218"
24+
appVersion: "18692524666"

ports/www/middleware/log.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/prometheus/client_golang/prometheus/promauto"
77
"go.uber.org/zap"
88
"net/http"
9-
"strings"
109
"time"
1110
"timekeeper/config"
1211
)
@@ -50,10 +49,12 @@ func Log(next http.Handler) http.Handler {
5049
requestDuration.Observe(float64(d.Milliseconds()))
5150
}
5251

53-
if strings.Contains(request.URL.Path, "/export/") {
54-
log.Debug("handled www request", zap.Duration("duration", d))
55-
} else {
52+
if d > 100*time.Millisecond {
53+
log.Warn("handled www request", zap.Duration("duration", d))
54+
} else if request.Method != http.MethodGet {
5655
log.Info("handled www request", zap.Duration("duration", d))
56+
} else {
57+
log.Debug("handled www request", zap.Duration("duration", d))
5758
}
5859
})
5960
}

0 commit comments

Comments
 (0)