I have several modules - let's say server.js, module1.js,...,moduleN.js.
I would like define the log file in my server.js:
winston.add(winston.transports.File, { filename: 'mylogfile.log' });
and then use it in all my modules.
What is the best way to do that? I could exports.winston=winston;
in each module and then set it in the server.js, but is there any better solution?
Thank you in advance!
I wanted to use custom colours and levels.
So I removed the default console-transport and set a colorized one
here is my logger.js
Loading from app.js:
Loading from other modules: