Reputation: 113
I feel like I'm missing something basic, but I can't work out how to get better console output in HapiJS.
I am writing an API, and at the moment when there is an error it prints out.
150516/063815.663, [response], http://localhost:3000: post /users{} 500 (120ms)
And returns a response saying "there was an internal server error".
What do I need to change to see what that error output actually was?
Upvotes: 2
Views: 949
Reputation: 2260
There are number of ways to log your Hapi.js project
Upvotes: 1
Reputation: 7550
It looks like you're using the Good plugin.
If so, you can change the console reporter to include Error logs by adding error: '*'
to the events hash.
reporters: [{
reporter: require('good-console'),
events: { log: '*', response: '*', error: '*' }
}]
Upvotes: 5