Winston Logging - separate levels to separate Transports

前端 未结 3 1488

I am using Winston for logging with 2 different transports - File and MongoDB. I have set the level for File as \"INFO\" and for MongoDB as \"ERROR\". If I now log,



        
3条回答
  •  时光说笑
    2021-01-21 12:53

    see this answer. I have written a wrapper for winston which covers the basic api. it needs extending for logging metadata, but otherwise its a good start. of course you will have to adjust this for your MongoDB needs.

提交回复
热议问题