As it stands, Ghost has errorHandling which is used throughout the system, leaving it reasonably consistent. We also have the nice red-white-green error messaging on the console to try to help people recover from issues.
Ghost is also reasonably good at recovering from problems, it has fall back and default behaviour in plenty of places... and we are improving that in other issues.
However, Ghost's log output is somewhat scarce when trying to debug problems. Ghost doesn't always tell people when something has gone a bit wrong... it can often just serve a non-OK response and sometimes the error can appear as a rendered 500 page but there's nothing in the log. We also don't log when we get empty responses from the DB etc.. we just carry on.
I want to look at how we can improve this without adding too much code. I'd like to add an extra level of logging information.
My initial thought is to start using logWarn, and only output this when in development mode, or when debug is set to true in config.js.
I'm not sure if this is the right approach though, I'm concerned about adding lots of extra code, and I'm also concerned that the improvement will be minimal without some sort of verbose logging mode in the middleware that traces through how a request is handled - express's logging is only about access logging as far as I can tell and won't output any more info.
So.. is there a way to log where next() gets called each time etc?
Thoughts in comments please :)
As it stands, Ghost has errorHandling which is used throughout the system, leaving it reasonably consistent. We also have the nice red-white-green error messaging on the console to try to help people recover from issues.
Ghost is also reasonably good at recovering from problems, it has fall back and default behaviour in plenty of places... and we are improving that in other issues.
However, Ghost's log output is somewhat scarce when trying to debug problems. Ghost doesn't always tell people when something has gone a bit wrong... it can often just serve a non-OK response and sometimes the error can appear as a rendered 500 page but there's nothing in the log. We also don't log when we get empty responses from the DB etc.. we just carry on.
I want to look at how we can improve this without adding too much code. I'd like to add an extra level of logging information.
My initial thought is to start using logWarn, and only output this when in development mode, or when debug is set to true in config.js.
I'm not sure if this is the right approach though, I'm concerned about adding lots of extra code, and I'm also concerned that the improvement will be minimal without some sort of verbose logging mode in the middleware that traces through how a request is handled - express's logging is only about access logging as far as I can tell and won't output any more info.
So.. is there a way to log where next() gets called each time etc?
Thoughts in comments please :)