Skip to content

Commit ecdb0be

Browse files
committed
Added to error logging details
1 parent ada0c08 commit ecdb0be

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

Gopkg.lock

Lines changed: 19 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

router.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func (r *APIGRouter) Respond() events.APIGatewayProxyResponse {
114114

115115
endpointTree = r.endpoints[r.request.HTTPMethod]
116116
path = strings.TrimPrefix(r.request.Path, r.prefix)
117+
inPath = path
117118
response = events.APIGatewayProxyResponse{}
118119
splitPath = stripSlashesAndSplit(path)
119120
)
@@ -165,7 +166,8 @@ func (r *APIGRouter) Respond() events.APIGatewayProxyResponse {
165166
status = 400
166167
}
167168

168-
log.Printf("%v error: %v", status, err.Error())
169+
log.Printf("%v %v %v error: %v \n", r.request.HTTPMethod, inPath, status, err.Error())
170+
log.Println("error causing body: " + r.request.Body)
169171
response.StatusCode = status
170172
response.Body = string(respbody)
171173
response.Headers = r.headers

0 commit comments

Comments
 (0)