I\'ve created:
var access = fs.createWriteStream(\'/var/log/node/api.access.log\', { flags: \'w\' });
Then piped:
process.s
process.stdout
is a Writable. pipe
is a method of Readable
(Cf StreamAPI documentation : https://nodejs.org/api/stream.html
You can see the documentation of process.stdout
here : https://nodejs.org/api/process.html#process_process_stdout
It's surprising that you can do process.stdout.pipe(...);
without any error. But i suppose this call just do nothing. Except returning a new Writable stream binded to stdout (or maybe it returns process.stdout
itself. There's no specification for that in the documentation).
If you want to redirect stdout to a file, you have many solutions :
node myfile.js > api.access.log
.process.stdout
with your own stream (and you can do whatever you want with this)