Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I customize the Hapi.js access log?

I'm using Hapi.js's Good and GoodFile for access logs by logging 'response' events. How can I customize the object that gets logged? Specifically, I do not want to include the 'query' property on response events when the 'statusCode' is a 404.

like image 428
JeremiahLee Avatar asked Feb 14 '26 16:02

JeremiahLee


1 Answers

good-file is not configurable in that fashion. It logs the JSON representation of the complete request. At present, if you want to control how the output is formatted, you will have to write your own custom reporter. Documentation can be found here.

You may also be able to fork good-file and just make some changes to the way the output is formatted.

like image 181
arb Avatar answered Feb 16 '26 05:02

arb