When we want a Node.js application to redirect every console.log
and console.info
into a file, we can use either >fileName
or 1>fileName
, which hooks into process.stdout
.
And when we want a Node.js application to redirect every console.warn
and console.error
into a file, we can use 2>fileName
, which hooks into process.stderr
.
But how can we redirect the complete console output (for all console methods) into a single file?
I'm looking for something that works on both Windows and Linux.