title: nodejs - log to console stdio and file using only core modules
body: <p>My application is simple and I want to avoid using a logging library like Winston. I need to log the output to both the console, and to file. I found a few tutorials on how to do this using a child process, such as <a href="https://nodejs.org/en/knowledge/advanced/streams/how-to-use-stream-pipe/" rel="nofollow noreferrer">this</a>, but I can't find anything that leverages the main process stdio, like process.stdout and process.stdin</p>