如何为复杂的应用程序设置winston记录器?

时间:2017-09-07 04:47:21

标签: node.js logging winston

如何在nodejs eco中获得 log4j 类似的记录器系统?我们可以看到 winston 是nodejs中扩展最多的记录器框架。但我们无法得到完全的结果。你能分享你的最佳实践记录器子系统吗?

如果我们得到类似log4j的记录器用例,那将是理想的:

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

我们希望登录控制台并旋转文件

  

date [LEVEL] loggerName:message

     

date [LEVEL] loggerName:message

     

date [LEVEL] loggerName:message

     

...

0 个答案:

没有答案