NestLens: Your Complete Debugger Friend for NestJS
Suman S.
Jan 27, 2026
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:
- HTTP requests and responses
- Database queries (automatic detection for TypeORM and Prisma)
- Application logs
- Unhandled exceptions
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:
- Headers
- Request and response bodies
- Status codes
- Execution time
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:
- Slow or inconsistent endpoints
- Authentication or middleware issues
- Unexpected payloads from clients
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:
- TypeORM
- Prisma
For each request, you can see:
- Executed SQL queries
- Query execution times
- Slow queries highlighted clearly
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:
- Full stack traces
- The request that triggered them
- Related logs and queries
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:
- Filter by log level (info, warn, error, etc.)
- Correlate logs to specific requests
- Follow log “families” across async boundaries
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:
- Bull or BullMQ queues
- Cron jobs or scheduled tasks
NestLens lets you inspect:
- Job execution
- Failures and retries
- Timing and duration
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:
- Cache hits and misses
- Cache reads and writes
- Rate-limited events
- And many other operational signals
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:
- A modern React-based dashboard
- Dark mode support
- Real-time updates
- Clean, intuitive navigation
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
- A working NestJS application
- Node.js and npm installed
Install NestLens:
Step 1: Import the NestLens Module
In your AppModule:
This ensures NestLens:
- Runs automatically in development
- Stays disabled in production by default
Step 2 (Optional but Recommended): Use the NestLens Logger
To capture all application logs inside the dashboard:
This enables full log visibility and request-level correlation.
Step 3: Open the Dashboard
Start your application and visit:
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:
- Trace complex request lifecycles end-to-end
- Group logs, queries, and errors automatically
- Identify performance bottlenecks early
- Reduce ad-hoc logging and local instrumentation
For teams, this often translates to:
- Faster onboarding for new developers
- Fewer “works on my machine” moments
- More confidence when refactoring or optimizing code
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:
- Debugging complex APIs
- Working with ORMs and background jobs
- Tired of piecing together logs by hand
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.