I have a NodeJS application that gets bundled via webpack before being deployed. In production, what's run is a single bundled dist/server.js file.
I'm having trouble debugging some errors in production, errors that don't always appear when I run it locally (even running dist/server.js locally). The issue isn't the errors that I'm encountering, but rather that the error log to stdout gets cut off due to server.js being so large. It's trying to write the stack trace, but it's writing this enormous file which is too large for the stdout buffer.
If I could see what these errors are, I'm sure I could fix them quickly. How can I tell node to not write the stack trace? Or, if there's some other way to log the error first, that would work, too.