How to setup winston logger for complex application?

135 Views Asked by At

How to get log4j-like logger system in nodejs eco? As we can see winston is the most extended logger framework in nodejs. But we can't get exactly result with it to. Can you share your best practice logger subsystem?

It would be ideal if we get log4j-like logger use case:

main.js

// configuring loggers "Class A", "Class B", "Class C"

ClassA.js

// get fully configured logger "Class A" from factory. Have not any logger configuration inside class
// use logger

ClassB.js

// get fully configured logger "Class B" from factory. Have not any logger configuration inside class
// use logger

ClassC.js

// get fully configured logger "Class C" from factory. Have not any logger configuration inside class
// use logger

We would like to get log into console and rotated files

date [LEVEL] loggerName: message

date [LEVEL] loggerName: message

date [LEVEL] loggerName: message

...

0

There are 0 best solutions below