Skip to content

Commit 0162cc9

Browse files
committed
fix(traefik): log all 4xx/5xx access events, not just slow retries
Traefik combines accessLog.filters fields with AND, so configuring both `retryAttempts: true` and `minDuration: '1s'` alongside `statusCodes: 400-599` meant a request had to be a 4xx/5xx AND have been retried AND have taken longer than 1s before it would appear in the access log. Most production errors were silently dropped — including the fast 500s that matter most. Drop the two extra filters so any 4xx/5xx is logged. Volume stays manageable because errors are a small fraction of total traffic; verbose normal-traffic logging remains gated behind the upstream `log.level: WARN` setting. Made-with: Cursor
1 parent 3f9fccb commit 0162cc9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/traefik/traefik.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ log:
2424
level: WARN # Reduced from INFO to reduce log volume
2525
format: json
2626

27-
# Access logs - only log errors (4xx/5xx) to reduce volume
27+
# Access logs — 4xx/5xx only (keeps volume low but still captures fast 500s).
28+
# Traefik combines filter fields with AND; retryAttempts + minDuration meant
29+
# most errors never appeared in logs. See docker-compose.prod.yml "Debugging".
2830
accessLog:
2931
format: json
3032
filters:
3133
statusCodes:
3234
- '400-599'
33-
retryAttempts: true # Only log retries
34-
minDuration: '1s' # Only log slow requests (>1s)
3535

3636
# -----------------------------------------------------------------------------
3737
# Entrypoints

0 commit comments

Comments
 (0)