【问题标题】:Any alternative of "newrelic-winston" package?\"newrelic-winston\" 包的任何替代方案?
【发布时间】:2023-01-31 02:57:42
【问题描述】:

我正在使用 NESTJS 应用程序和 New Relic 查看日志。 为了发送日志,我使用了 winston 和 newrelic-winston 包。 但我看到 newrelic-winston 已贬值。 你知道那个的其他选择吗?

const NewrelicWinston = require('newrelic-winston');
import * as winston from 'winston';
import { WinstonModule } from 'nest-winston';
import { utilities as nestWinstonModuleUtilities } from 'nest-winston/dist/winston.utilities';

const configs = {
      format: winston.format.combine(
        winston.format.timestamp(),
        nestWinstonModuleUtilities.format.nestLike(),
      ),
    };

    const app = await NestFactory.create(AppModule, {
      logger: WinstonModule.createLogger({
        transports: [
          new winston.transports.Console(configs),
          new NewrelicWinston(configs),
        ],
      }),
    });

【问题讨论】:

    标签: logging nestjs newrelic winston


    【解决方案1】:

    Node.js 代理支持 Winston 3.0.0 或更高版本。

    查看这个 New Relic Doc 了解更多信息:https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-nodejs/#automatic

    (建议:确保客户使用的是最新的 Node agent)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-27
      • 2010-10-03
      • 2011-11-05
      • 1970-01-01
      • 2017-12-25
      • 1970-01-01
      相关资源
      最近更新 更多