NestLens: Your Complete Debugger Friend for NestJS

NestLens: Your Complete Debugger Friend for NestJS

Written by
Written by

Suman S.

Post Date
Post Date

Jan 27, 2026

shares

If you’ve built anything non-trivial with NestJS, you’ve likely hit the same wall at some point.

A request fails, but the logs don’t quite tell the full story.

A query is slow, but you’re not sure which repository call triggered it.

An exception bubbles up, stripped of the context you actually need to debug it.

You end up bouncing between terminal logs, browser dev tools, and database consoles — mentally stitching together what happened.

NestLens exists to remove that gap.

It’s a development-time debugging and observability tool for NestJS that shows you what your application is doing as a system, not as scattered signals. Requests, database queries, logs, background jobs, cache operations, and errors all appear in a single, coherent timeline — so debugging becomes inspection instead of guesswork.

What Is NestLens?

At its core, NestLens captures and visualizes everything happening inside your NestJS application during development.

With essentially zero configuration, it starts tracking:

Beyond that, NestLens provides 18 different “watchers” that cover nearly every operational aspect of a typical NestJS backend — from background jobs to cache activity.

A useful mental model is this:

NestLens is a time machine with X-ray vision for your backend.

Instead of reproducing bugs with extra console.log calls or digging through log output after the fact, you get a real-time, contextual view of what happened and why.

The Features That Actually Matter (and Why)

Rather than listing everything NestLens can do, let’s focus on the parts that most directly change how you debug day to day.

1. HTTP Request Tracking

NestLens captures every incoming HTTP request with full context:

More importantly, each request becomes an anchor for everything else — logs, queries, and errors are correlated to the request that triggered them.

This is invaluable when debugging:

Instead of scanning logs chronologically, you inspect a request and see its entire lifecycle in one place.

2. Database Query Monitoring

NestLens automatically detects and tracks database activity for:

For each request, you can see:

This removes a common blind spot in ORM-heavy applications. Rather than guessing which repository call is responsible for performance issues, the answer is immediately visible — often within seconds of hitting an endpoint.

3. Exception and Error Tracking

Unhandled exceptions are captured with:

This context is what’s usually missing when an error surfaces in isolation. With NestLens, you don’t just see that something failed — you see the chain of events that led to the failure.

4. Application Logs (Without Grepping)

By using the NestLens logger, you can capture all application logs inside the dashboard and:

This quickly replaces the need to grep terminal output or add temporary debug logs just to understand execution flow.

5. Background Jobs and Scheduled Tasks

If your application uses:

NestLens lets you inspect:

Debugging async workflows is notoriously painful. Having job execution visible alongside requests and logs makes these flows far easier to reason about.

6. Cache Operations and Other Signals

NestLens also tracks:

Altogether, these watchers provide near-complete visibility into what your application is doing during development — without introducing the overhead of a full production APM.

7. A UI That Encourages Use

Tooling only helps if developers actually enjoy using it.

NestLens ships with:

Instead of feeling like “extra tooling,” it quickly becomes the first place you look when something feels off.

Setting Up NestLens in a NestJS Project (5 Minutes)

Prerequisites

Install NestLens:

npm install nestlens

Step 1: Import the NestLens Module

In your AppModule:

import { Module } from '@nestjs/common'; import { NestLensModule } from 'nestlens'; @Module({ imports: [ NestLensModule.forRoot({ enabled: process.env.NODE_ENV !== 'production', }), ], }) export class AppModule {}

This ensures NestLens:

Step 2 (Optional but Recommended): Use the NestLens Logger

To capture all application logs inside the dashboard:

import { NestFactory } from '@nestjs/core'; import { NestLensLogger } from 'nestlens'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule, { bufferLogs: true, }); const logger = app.get(NestLensLogger); app.useLogger(logger); await app.listen(3000); } bootstrap();

This enables full log visibility and request-level correlation.

Step 3: Open the Dashboard

Start your application and visit:

http://localhost:3000/nestlens

You’re live.

What NestLens Enables Once It’s Installed

The real value of NestLens shows up after the first few debugging sessions.

With it in place, you can:

For teams, this often translates to:

It quietly changes how you reason about your backend.

Final Thoughts

NestLens isn’t just another logging library — it’s a development-time observability layer built specifically for NestJS.

If you’re:

NestLens can quickly become your default debugging companion.

It’s TypeScript-native, requires minimal setup, and stays out of production unless you explicitly enable it. For modern NestJS development, it feels less like an optional tool and more like a missing piece of the ecosystem.

If you found this guide useful, consider sharing it with your team or bookmarking it for your next deployment.

We regularly write about backend architecture, DevOps practices, and building reliable production systems. visit our site for more engineering deep dives and practical guides from the field.