API: Include IP address when logging request error (#21596)

Includes IP address when logging request error, for example 
when a user fails to login.

Fixes #21310
This commit is contained in:
Mohit Gupta 2020-03-02 14:13:16 +05:30 committed by GitHub
parent f9962eabff
commit 94951df1c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,8 @@ func Wrap(action interface{}) macaron.Handler {
func (r *NormalResponse) WriteTo(ctx *m.ReqContext) {
if r.err != nil {
ctx.Logger.Error(r.errMessage, "error", r.err)
ctx.Logger.Error(r.errMessage, "error", r.err, "remote_addr", ctx.RemoteAddr())
}
header := ctx.Resp.Header()