ecs-logging-nodejs icon indicating copy to clipboard operation
ecs-logging-nodejs copied to clipboard

[Feature Request] extract `Error.cause` stacks when logging errors

Open gioragutt opened this issue 1 year ago • 1 comments

Now that Error.cause is somewhat standard, it's be great if the cause chain's stack traces would also be extracted when logging errors, sort of like the default .toString() of exceptions in Java.

From what I could gather in the code, only err.stack is extracted.

Looking at recent NodeJS docs, it does look like the internal formatter/inspector already handles the cause of an error when printing it.

gioragutt avatar Nov 15 '23 08:11 gioragutt