How to properly use Winston
问题 I have read the docs for logging in node.js using the winston package. My question: Do I need to add my logging module to every single page that requires logging.. or does winston somehow intercept console.log and console.error . thanks for your time. 回答1: Normally, you'd need to require your logger in the modules that use it. However, you can follow the suggestion made by @spmason in the gist logging.js or what @fega suggests in his comment to redefine the properties of the console Object: