Well Actually
Well Actually

Reputation: 1753

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.

Upvotes: 3

Views: 832

Answers (1)

arb
arb

Reputation: 7863

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.

Upvotes: 3

Related Questions