Closed andersjanmyr closed 7 years ago
I'm not sure what issue you are having? What isn't working?
The third event, response
, used to get the request
events aggregated into its log property.
(Spaces added for clartity). I don't see them anymore. I upgraded from Good 6.1.4.
{"event":"response","timestamp":1490319886053,"id":"1490319886053:m-C02RN22XG8WM.local:92527:j0n5yoee:10000","instance":"http://0.0.0.0:8080","labels":[],"method":"post","path":"/v2/users/login","query":{},"responseTime":873,"responseSentTime":872,"statusCode":200,"pid":92527,"httpVersion":"1.1","source":{"remoteAddress":"127.0.0.1","userAgent":"curl/7.51.0"},"route":"/v2/users/login","log":[
{"event":"request","timestamp":1490319886064,"tags":["dingo"],"data":"dong","pid":92527,"id":"1490319886053:m-C02RN22XG8WM.local:92527:j0n5yoee:10000","method":"post","path":"/v2/users/login","config":{}},
{"event":"request","timestamp":1490319886066,"tags":["options"],"data":{"username":"test5126044780@email.com","password":"XXXXXXX"},"pid":92527,"id":"1490319886053:m-C02RN22XG8WM.local:92527:j0n5yoee:10000","method":"post","path":"/v2/users/login","config":{}}
],"headers":{"host":"0.0.0.0:8080","user-agent":"curl/7.51.0","accept":"*/*","content-type":"application/json","cache-control":"no-cache","postman-token":"a7f20b54-572e-350d-b903-f8621a72195a","content-length":"70"},"requestPayload":{"username":"test5126044780@email.com","password":"XXXXXXX"},"responsePayload":{"status":0,"data":{"username":"test5126044780@email.com"}},"config":{}}
https://github.com/hapijs/good/blob/master/lib/utils.js#L83-L85
Looks like there was a change in this area in hapi. Try fiddling with the route settings.
@arb Thanks a lot, you solved it! :)
The following configuration enabled the aggregated events again.
const server = new Hapi.Server({ connections: { routes: { log: true } } });
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
My log events don't show up in the response event after I upgraded to Good 7.1.0. I have also upgrade to Hapi 16.1.0.
Perhaps my configuration is wrong, but I have checked it over and over and I can't figure it out. The
response.log
grouping is my favorite feature of Good and I would sure miss it if it's gone. Any help would be greatly appreciated.The logs show the individual request events, but the
response.log
is empty.Here's the config and the log events follow.