angular - 在 Angular 应用程序中使用 Winston 记录器

标签 angular logging winston

我想在客户端日志记录中使用winston logger,因为我计划使用传输功能来记录所有客户端信息。

app.module.ts
  ..
  import { logger}  from 'winston';
  @NgModule({
        ...
        providers: [logger]
        ...
  }) 
  export class AppModule{}

但是我的 Angular 应用程序是从 Angular cli 生成的,并使用 Webpack 进行依赖管理,

一旦符合,它就会发出以下警告。

WARNING in ./node_modules/winston/node_modules/colors/lib/colors.js
127:29-43 Critical dependency: the request of a dependency is an expression

并且应用程序无法加载。

同样的人遇到同样的问题并且知道如何解决它吗?

最佳答案

我猜 winston 仅适用于服务器端使用。请参阅此问题以获取更多信息:

https://github.com/winstonjs/winston/issues/287

关于angular - 在 Angular 应用程序中使用 Winston 记录器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46899823/

相关文章:

asp.net - MVC 5 & Angular 2 Multiple "Siloed"应用程序结构建议

ios - Angular 6 日期管道在 iPhone safari 浏览器上不显示任何内容

node.js - winston postgresql 自定义 sql/tableName 不工作

node.js - Node winston 不支持多文件传输?

javascript - nodejs 将行号添加到基于 winston 的记录器

angular - 在 Angular2 中,使用继承还是注入(inject)依赖?

javascript - 如何使用 Jquery 在 angular 5 上触发点击事件

java - 如何在 beans 实例化之前记录 spring boot 应用程序的所有 Activity 属性?

python - 将子进程日志重定向到 wxpython txt ctrl

java - Log4j2 配置 - 找不到 log4j2 配置文件