npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dev-log-monitor

v1.0.1

Published

Lightweight local log diagnostics for NestJS, Express, and Node.js development with real-time UI, error tracing, and breadcrumbs

Readme


Quick Start

npm install dev-log-monitor
// Add this ONE LINE at the top of your entry file
import 'dev-log-monitor/auto';

// That's it. Open http://localhost:3333
console.log('This will appear in the dev-log UI!');

Auto-disables in production (NODE_ENV=production). Zero config needed.


Why dev-log-monitor?

| Problem | Solution | |---------|----------| | "Which console.log printed this?" | Source location tracking (file:line -> function()) | | "What happened before the crash?" | Breadcrumbs - last 10 logs before any error | | "I can't read these stack traces" | Parsed & highlighted - your code vs node_modules | | "Logs are flying by too fast" | Real-time web UI with filtering, search, and export | | "Sensitive data in logs" | Auto-masks passwords, tokens, cards, SSNs (72+ fields) | | "Different loggers everywhere" | Works with console, Winston, Pino, Bunyan, or custom |


Features

One-Line Integration import 'dev-log-monitor/auto' intercepts all console methods, starts the UI, and enables masking.

Real-Time Web UI Beautiful log viewer at localhost:3333 with WebSocket live updates, dark/light themes, and vim-style keyboard shortcuts.

Source Location Every log shows file, line, column, and function name. No more guessing.

Breadcrumbs See the last 10 logs before any error. Full context for every crash.

Sensitive Data Masking Auto-redacts passwords, tokens, API keys, credit cards, SSNs. Add custom patterns too.

Timing & Metrics Timing deltas between logs, operation timers, error rates, and throughput tracking.

Parsed Stack Traces App code highlighted, node_modules collapsed. Copy or expand with one click.

Alerts & Webhooks Get notified on error spikes, pattern matches, or slow operations.


Framework Integration

NestJS

// main.ts
import 'dev-log-monitor/auto';
import { NestFactory } from '@nestjs/core';
import { devLogger, DevLogContextInterceptor } from 'dev-log-monitor';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule, {
    logger: devLogger.nest(),
  });
  app.useGlobalInterceptors(new DevLogContextInterceptor());
  await app.listen(3000);
}
bootstrap();

Use in services:

import { Injectable } from '@nestjs/common';
import { devLogger } from 'dev-log-monitor';

@Injectable()
export class UserService {
  private logger = devLogger.create('UserService');

  async createUser(data: CreateUserDto) {
    this.logger.info('Creating user', { email: data.email });
  }
}

Express

import 'dev-log-monitor/auto';
import express from 'express';
import { expressContextMiddleware } from 'dev-log-monitor';

const app = express();
app.use(expressContextMiddleware());

app.get('/api/users', (req, res) => {
  console.log('Fetching users');  // Automatically captured!
  res.json({ users: [] });
});

app.listen(3000);

Winston / Pino / Bunyan

import 'dev-log-monitor/auto';
import { wrapLogger } from 'dev-log-monitor';

// Winston
import winston from 'winston';
const winstonLogger = winston.createLogger({ level: 'info', transports: [new winston.transports.Console()] });
const logger = wrapLogger(winstonLogger, 'winston');

// Pino
import pino from 'pino';
const pinoLogger = wrapLogger(pino(), 'pino');

// Bunyan
import bunyan from 'bunyan';
const bunyanLogger = wrapLogger(bunyan.createLogger({ name: 'myapp' }), 'bunyan');

Plain Node.js

import 'dev-log-monitor/auto';

// All console calls are now captured
console.log('Application started');
console.warn('Cache miss', { key: 'user:123' });
console.error('Database connection failed');

// Or use the devLogger directly
import { devLogger } from 'dev-log-monitor';
devLogger.info('Direct log', { data: 'value' });

Configuration

All config via environment variables - no config files needed:

| Variable | Default | Description | |----------|---------|-------------| | DEV_LOG_PORT | 3333 | Web UI port | | DEV_LOG_DIR | .dev-log | Log storage directory | | DEV_LOG_RETENTION | 3 | Days to keep logs | | DEV_LOG_CONSOLE | true | Also print to console | | DEV_LOG_INTERCEPT | true | Intercept console.log calls | | DEV_LOG_MASKING | true | Auto-mask sensitive data | | DEV_LOG_STORAGE_LEVEL | debug | Minimum level to persist | | DEV_LOG_DISABLE | false | Disable entirely |

Or configure programmatically:

import { autoInit } from 'dev-log-monitor';

await autoInit({
  port: 3333,
  logDir: '.dev-log',
  retentionDays: 3,
  consoleOutput: true,
  interceptConsole: true,
  storageLevel: 'debug',
  maxFileSize: 50 * 1024 * 1024,
  maxTotalSize: 100 * 1024 * 1024,
});

Web UI

Open http://localhost:3333 after adding the import.

Keyboard Shortcuts:

| Key | Action | Key | Action | |-----|--------|-----|--------| | / | Focus search | t | Toggle theme | | j/k | Next/prev log | m | Toggle metrics | | Enter | Expand/collapse | e | Export logs | | 1-4 | Filter by level | c | Clear logs | | ? | Show shortcuts | Esc | Close/clear |

Error details show source location, breadcrumbs (last 10 logs before the error), and parsed stack traces with your app code highlighted.


Request Context & Correlation

import { asyncContext, getTraceId } from 'dev-log-monitor';

asyncContext.run(() => {
  console.log('Start processing');  // auto-assigned traceId
  someAsyncOperation().then(() => {
    console.log('Done processing');  // same traceId
  });
}, { method: 'GET', path: '/api/users' });

Alerting

import { addAlertRule, addWebhook } from 'dev-log-monitor';

addWebhook('slack', { url: 'https://hooks.slack.com/services/xxx', method: 'POST' });

addAlertRule({
  id: 'high-error-rate',
  name: 'High Error Rate',
  condition: { type: 'error_rate', threshold: 5 },
  handlers: ['webhook:slack', 'console'],
  cooldownMs: 60_000,
});

Sensitive Data Masking

import { configureMasking } from 'dev-log-monitor';

configureMasking({
  enabled: true,
  sensitiveKeys: ['myCustomSecret'],
  customPatterns: [
    { name: 'order-id', pattern: /ORDER-\d{6,}/g, replacement: 'ORDER-[REDACTED]' },
  ],
  fullMask: false,
  maskChar: '*',
});

Built-in: password, token, apiKey, authorization, ssn, creditCard, cvv, pin, and 50+ more.


API Reference

| Export | Description | |--------|-------------| | import 'dev-log-monitor/auto' | One-line auto-integration | | autoInit(config) | Configure and initialize manually | | configureMasking(options) | Configure sensitive data masking | | wrapLogger(logger, type?) | Wrap existing logger | | asyncContext | Request context manager | | getTraceId() | Get current trace ID | | getRequestId() | Get current request ID | | expressContextMiddleware() | Express middleware for context | | DevLogContextInterceptor | NestJS interceptor for context |

| Export | Description | |--------|-------------| | addAlertRule(rule) | Add custom alert rule | | addWebhook(name, config) | Add named webhook endpoint | | configureAlerts(config) | Configure alerts with rules and webhooks |

| Export | Description | |--------|-------------| | getMetrics() | Get current metrics snapshot | | onMetricsUpdate(callback) | Subscribe to metrics updates (returns unsubscribe fn) |

| Method | Description | |--------|-------------| | devLogger.init(config?) | Initialize manually (not needed with /auto) | | devLogger.debug(message, metadata?) | Log debug message | | devLogger.info(message, metadata?) | Log info message | | devLogger.warn(message, metadata?) | Log warning message | | devLogger.error(message, metadata?) | Log error message | | devLogger.create(context, source?) | Create scoped logger | | devLogger.nest() | Get NestJS adapter | | devLogger.express() | Get Express middleware | | devLogger.shutdown() | Gracefully shutdown |

| Method | Description | |--------|-------------| | logger.debug(message, metadata?) | Log debug with context | | logger.info(message, metadata?) | Log info with context | | logger.warn(message, metadata?) | Log warning with context | | logger.error(message, metadata?) | Log error with context | | logger.startTimer(operation) | Start operation timer |


CLI

npx dev-log-monitor clear    # Clear all logs
npx dev-log-monitor status   # Show storage status
npx dev-log-monitor help     # Help

Log Storage

Logs are stored in .dev-log/ in JSONL format, named by date (logs-YYYY-MM-DD.jsonl).

Add to .gitignore:

.dev-log/

Requirements

  • Node.js >= 18.0.0
  • TypeScript optional, but recommended
  • Peer deps (optional): @nestjs/common >= 9.0.0, express >= 4.0.0

License

MIT

Contributing

Contributions are welcome! Please open an issue or submit a pull request at GitHub.