hapijs / good

hapi process monitoring
Other
525 stars 161 forks source link

Server logging still loses the error. #584

Closed cpomerantz closed 5 years ago

cpomerantz commented 6 years ago

Sorry to raise the dead on this issue but passing an error to server.log still results in losing the error. The ServerLog class will not assign the error in the constructor like the other classes will and Hapi core.js is assigning an Error type value to error instead of data like this:

    const field = (data instanceof Error ? 'error' : 'data');

    let event = { timestamp, tags, [field]: data, channel };

If the ServerLog class can assign the error then things would work like the other classes. I know I could do this:

    server.log(['tags'], { error: error });

and then handle this in a custom filter. But I feel like it is more consistent if the ServerLog just assigned the error. I can create a PR if you like.

rankida commented 6 years ago

Is this fixed by https://github.com/hapijs/good/pull/585 ?

lock[bot] commented 4 years ago

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.