mirror of
https://github.com/traefik/traefik.git
synced 2025-11-28 22:21:36 +01:00
Rename the non-exposed field "count" to "size"
This commit is contained in:
parent
da3d814c8b
commit
377c219fd9
@ -3,8 +3,10 @@ package accesslog
|
|||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
type captureRequestReader struct {
|
type captureRequestReader struct {
|
||||||
|
// source ReadCloser from where the request body is read.
|
||||||
source io.ReadCloser
|
source io.ReadCloser
|
||||||
count int64
|
// count Counts the number of bytes read (when captureRequestReader.Read is called).
|
||||||
|
count int64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *captureRequestReader) Read(p []byte) (int, error) {
|
func (r *captureRequestReader) Read(p []byte) (int, error) {
|
||||||
|
|||||||
@ -129,5 +129,6 @@ type downstreamResponse struct {
|
|||||||
|
|
||||||
type request struct {
|
type request struct {
|
||||||
headers http.Header
|
headers http.Header
|
||||||
count int64
|
// Request body size
|
||||||
|
size int64
|
||||||
}
|
}
|
||||||
|
|||||||
@ -214,7 +214,7 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request, next http
|
|||||||
size: crw.Size(),
|
size: crw.Size(),
|
||||||
}
|
}
|
||||||
if crr != nil {
|
if crr != nil {
|
||||||
logDataTable.Request.count = crr.count
|
logDataTable.Request.size = crr.count
|
||||||
}
|
}
|
||||||
|
|
||||||
if h.config.BufferingSize > 0 {
|
if h.config.BufferingSize > 0 {
|
||||||
@ -280,7 +280,7 @@ func (h *Handler) logTheRoundTrip(logDataTable *LogData) {
|
|||||||
retryAttempts = 0
|
retryAttempts = 0
|
||||||
}
|
}
|
||||||
core[RetryAttempts] = retryAttempts
|
core[RetryAttempts] = retryAttempts
|
||||||
core[RequestContentSize] = logDataTable.Request.count
|
core[RequestContentSize] = logDataTable.Request.size
|
||||||
|
|
||||||
status := logDataTable.DownstreamResponse.status
|
status := logDataTable.DownstreamResponse.status
|
||||||
core[DownstreamStatus] = status
|
core[DownstreamStatus] = status
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user