Commit 74c1d30
committed
feat(http,logging,har): add configurable request/response body limits and enhanced access logging
Add support for form parameter tracing, configurable body size limits via properties, and improved access logging with error-only mode.
Key changes:
- HAR middleware now respects http.har.maxBodySize property for per-body capture limits
- HTTP logger supports form parameter tracing independently of raw body capture
- New AccessLog and AccessLogErrorsOnly config options for single-line access logs
- Error responses (>= 400) and transport errors always log with body at INFO level
- Successful requests silent at INFO, visible at DEBUG and above
- Query parameters and form data displayed separately in pretty logging
- Enhanced header redaction with wildcard pattern support
- Improved verbosity level calculation for trace configuration
BREAKING CHANGE: NewLogger no longer accepts AccessLog config as a shortcut; use TraceConfig.AccessLog instead. The access log behavior has changed: error-only mode (AccessLogErrorsOnly) now surfaces failures at -v=0 without per-request spam.1 parent 1999d10 commit 74c1d30
7 files changed
Lines changed: 588 additions & 74 deletions
File tree
- har
- http
- middlewares
- logger/httpretty
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
| |||
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
23 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
24 | 35 | | |
25 | 36 | | |
26 | | - | |
| 37 | + | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments