节点JS日志记录-Winston.Logger不是构造函数 [英] Node js logging - winston.Logger is not a constructor

查看:77
本文介绍了节点JS日志记录-Winston.Logger不是构造函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Winston在node js应用程序中应用logger,但获取winston.Logger不是构造函数.我正在关注下面的链接

I am applying logger in node js application using Winston but getting winston.Logger is not a constructor. I am following the link below

http://thisdavej.com/使用Winston的多功能日志库来处理节点js/

推荐答案

由于将winston.Logger更改为winston.createLogger,因此出现此错误.更新代码以使用.createLogger应该可以解决您的问题.

You are getting this error because winston.Logger has been changed to winston.createLogger. Updating your code to use .createLogger should fix your problem.

请参阅本文档 https://github.com/winstonjs/winston#usage

这篇关于节点JS日志记录-Winston.Logger不是构造函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆