node.js - 有谁知道如何在 NestJS 中实现 Honeybadger 日志记录?
问题描述
NestJS 使用 express,而 Honeybadger 有一个 express 中间件,但我似乎无法弄清楚如何实现它。目前我的 main.ts 文件看起来像这样
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ConfigService } from '@nestjs/config';
import * as Honeybadger from 'honeybadger';
Honeybadger.configure({
apiKey: '??hidden for security reasons??'
})
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
logger: false,
});
app.use(Honeybadger.requestHandler);
app.use(Honeybadger.errorHandler);
const configService = app.get(ConfigService);
await app.listen(configService.get('PORT'));
}
bootstrap();
解决方案
推荐阅读
- stanford-nlp - 将特定领域的实体添加到 spaCy 或斯坦福 NLP 训练集
- vba - 修改 Word 文档多级列表以包括所有深度
- php - 如何在 twig 中创建一个函数来使用 Symfony 计算一个人的年龄
- angularjs - ngOptions 绑定变量链接到选项选择
- javascript - AngularJS uib-typeahead 不更新值列表
- entity-framework - Ef Core - 审核更改并包括导航属性
- vb.net - 我如何将非特定类传递给子
- mysql - AES_DECRYPT 从打字稿中的 blob 中获取值
- javascript - 如何将语音添加到 JS 应用程序的文本中?
- python - nytimesarticle api 不断收到关键错误:KeyError: 'news_desk'