Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
feat(logs): Hapi 17 standard compliant logs (#33)
Browse files Browse the repository at this point in the history
refs #SREPR-731
  • Loading branch information
dm03514 authored Feb 24, 2020
1 parent 258f33e commit 0c393ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion eventlogger/hapi_server_v17.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ module.exports.watch = function (logger, server, options) {

function createLogEntry(request, log_type) {
const took = Date.now() - request.info.received;
const res = request.response;

return {
log_type,
took,
req: request,
res: request.response
res: {
status_code: res.statusCode,
headers: res.headers,
},
};
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"mocha": "~2.3.2"
},
"dependencies": {
"@a0/logs-schemas": "^0.4.0",
"@a0/logs-schemas": "^0.4.2",
"jsonschema": "^1.2.5",
"lodash": "^4.17.11",
"request": "^2.27.0",
Expand Down

0 comments on commit 0c393ab

Please sign in to comment.