Star us on GitHub
Star
Menu

Logging in Nest.js

Learn how to set up highlight.io log ingestion in Nest.js.
1
Set up your frontend highlight.io integration.

First, make sure you've followed the frontend getting started guide.

2
Add the @highlight-run/nest app middleware.

Use the HighlightLogger middleware to record backend logs in highlight.io

import { HttpAdapterHost, NestFactory } from '@nestjs/core' import { AppModule } from './app.module' import { HighlightLogger } from '@highlight-run/nest' async function bootstrap() { const app = await NestFactory.create(AppModule) app.useLogger( new HighlightLogger({ projectID: '<YOUR_PROJECT_ID>', serviceName: 'my-nestjs-app', serviceVersion: 'git-sha', environment: 'production' }) ) await app.listen(3000) } bootstrap()
Copy
3
Verify your backend logs are being recorded.

Visit the highlight logs portal and check that backend logs are coming in.