1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 03:10:58 +00:00

Add Content-length field for logging

This commit is contained in:
IamCathal 2020-07-20 21:21:59 +01:00
parent 7a48fbb698
commit a66b9950e7

View File

@ -1046,7 +1046,7 @@ func LogAccess(ctx *beecontext.Context, startTime *time.Time, statusCode int) {
HTTPReferrer: r.Header.Get("Referer"), HTTPReferrer: r.Header.Get("Referer"),
HTTPUserAgent: r.Header.Get("User-Agent"), HTTPUserAgent: r.Header.Get("User-Agent"),
RemoteUser: r.Header.Get("Remote-User"), RemoteUser: r.Header.Get("Remote-User"),
BodyBytesSent: 0, // @todo this one is missing! BodyBytesSent: r.ContentLength,
} }
logs.AccessLog(record, BConfig.Log.AccessLogsFormat) logs.AccessLog(record, BConfig.Log.AccessLogsFormat)
} }