Server integration
Node.js Monitoring for Express, NestJS and Next.js
LoggerAI monitors Express, Fastify, NestJS, Next.js and any app on Node's http server. Call init() once and every endpoint, query and crash is recorded.
What LoggerAI records
- Every endpoint under its route template (/orders/:id): p50, p95, p99, Apdex, status codes, slow and failed requests
- PostgreSQL (pg), MySQL (mysql2) and Redis (ioredis)
- Outgoing HTTP through fetch, http, axios and got
- Exceptions, uncaught exceptions and unhandled rejections
- Logs from console.warn and console.error
- Health checks you define
- CPU, memory and disk every 30 seconds, inside Docker against the container's limits
- Queue jobs, cron tasks and scripts, timed like requests
Node 18.17 or later, with no dependencies.
How to set it up
1. Install the package
npm install @loggerai/node2. Add your key
Get your project's secret key (sk_live_...) from LoggerAI, on your project's Connect page, and set it in the environment. Without a key nothing is recorded or sent, so local development stays quiet.
LOGGERAI_KEY=sk_live_... LOGGERAI_RELEASE=$GIT_SHA # optional3. Turn it on
Call init() once, before the app starts listening and before your database clients connect. In NestJS, call it at the top of main.ts.
const loggerai = require('@loggerai/node') loggerai.init() const app = express() // ... your routes ... app.use(loggerai.expressErrorHandler()) // after the routes4. Check it can reach LoggerAI
npx @loggerai/node test
See every integration, or what you can do with the data in features.
Questions
- Does it record my API responses?
- Secrets such as passwords, tokens, cookies, API keys and JWTs are masked before anything leaves your server. Request and response bodies are never sent, and users are counted by a one-way hash of their id.
- Does it work inside Docker?
- Yes. Server metrics are measured against the container's own limits.
Try it on your own app
The Free plan is free for good, and needs no card.