Nodejs and logging through different modules

I'm just interested in a better approach to the following ...

I have an application that breaks down into several modules for maintenance and separation problems. I want to be able to create a log file at the start of my application, and then use the different modules that I wrote, write to the same log file without becoming messy and having unnecessary code in my exported modules.

Thanks in advance.

+5
source share
1 answer

Use Winston for logging, it can write a file, db, whatever, and it has good documentation. You can use Winston to register messages for all of your modules.

+11
source

All Articles