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

logsphere

v1.2.1

Published

A ready-to-use, professional Node.js logging system with a built-in web dashboard, log rotation, sensitive data redaction, and beautiful console output.

Readme

🪐 LogSphere

Transparent, Resilient, and Beautiful Logging for Node.js & Express.

npm version License: MIT

LogSphere is a zero-config-needed logging suite that gives you "Enterprise Grade" visibility without the complexity. It turns your messy terminal logs into a structured, searchable, and visual experience.


⚡️ The 30-Second Setup

Stop wrestling with configurations. LogSphere works out of the box.

const express = require('express');
const { expressLogger, dashboard } = require('logsphere');

const app = express();

// 1. Log every request automatically
app.use(expressLogger({ logBody: true }));

// 2. See your logs in a beautiful UI at /dashboard
app.use('/dashboard', dashboard({ username: 'admin', password: '123' }));

app.listen(3000);

🔧 Configuration Methods

LogSphere uses a "Unified Config" system. Whether you use configure() or expressLogger(), you can pass the same set of options.

What's the difference?

  • configure(options): Sets Global Defaults. This applies to everything (middleware, manual logs, dashboard).
  • expressLogger(options): Sets Local Overrides. These settings apply only to that specific middleware instance, allowing you to have different logging rules for different API sections.

[!NOTE] Do I need both?
configure() only sets the rules. To actually start capturing HTTP requests automatically, you must still add app.use(expressLogger()) to your application.

const { configure, expressLogger } = require('logsphere');

// 1. Set global rules (Applies everywhere)
configure({ 
  logDir: path.join(__dirname, 'logs'),
  logBody: true 
});

// 2. Use defaults
app.use(expressLogger()); 

// 3. Override for specific routes
app.use('/api/v2', expressLogger({ 
  logBody: false, // Turn off body logging just for V2
  slowRequestThresholdMs: 500 // Be stricter with performance here
}));

📋 Unified Options Table (Accepted by both)

| Option | Default | Description | | :--- | :--- | :--- | | logDir | './logs' | Path to store logs (Absolute recommended). | | minLevel | 'DEBUG' | Min level: DEBUG, INFO, WARN, ERROR. | | logBody / logBodys | false | Capture incoming req.body. | | logHeaders / logHeader | false | Capture incoming request headers. | | logQuery / logQueries | true | Capture URL query parameters. | | logResponse | false | Capture outgoing response body. | | excludePaths | [] | Array of path prefixes to skip from logging. | | sensitiveKeys | [...] | List of keys to redact (Case-Insensitive). | | slowRequestThresholdMs | 2000 | Flag requests exceeding this duration. | | maxExpireDays | false | Auto-delete logs older than X days. | | discordWebhookUrl | null | Target Discord Webhook for ERROR alerts. | | enableConsoleLogs | true | Toggle the colorized terminal output. |

🚦 Log Level Hierarchy (minLevel)

The minLevel setting follows a strict hierarchy. When you set a minimum level, LogSphere captures that level and everything above it.

DEBUG (1) < INFO (2) < WARN (3) < ERROR (4)

  • minLevel: 'INFO': Captures INFO, WARN, and ERROR. (Ignores Debug)
  • minLevel: 'ERROR': Captures only ERRORs. (Best for quiet production)
  • minLevel: 'DEBUG': Captures Everything. (Default for development)

🚀 Middleware & Dashboard

expressLogger(options)

Zero-setup middleware. It automatically inherits from configure(), but you can pass local overrides if needed.

app.use(expressLogger({ 
  logBody: false // Override global setting for this instance
}));

dashboard(options)

Mounts the Web UI. Requires username and password for security.

app.use('/dashboard', dashboard({
  username: 'admin',
  password: 'your-secure-password'
}));

🎨 Dashboard Preview

| 🌙 Dark Mode | ☀️ Light Mode | | :---: | :---: | | Dark UI | Light UI |


🎨 Dashboard Experience

The dashboard is built for developers. No bulky setup—it's just a middleware.

  • Live Mode: Click "Auto" and watch logs stream in as they happen.
  • Deep Search: Filter by Request ID, IP Address, or status codes instantly.
  • Expandable Rows: Click any log to see its metadata, body, and colorized stack traces.
  • Self-Healing: If files are cleared/deleted, the logger re-creates them instantly.

🩺 Direct Logging & Levels

You can use LogSphere anywhere in your code, even outside of Express. Each method corresponds to a severity level and is color-coded in your terminal.

Available Methods

| Method | Level | Terminal Icon | Best Use Case | | :--- | :--- | :---: | :--- | | debug(msg, meta) | DEBUG | 🐛 | High-volume technical details for development. | | info(msg, meta) | INFO | ℹ️ | General app flow (Server start, user login). | | warn(msg, meta) | WARN | ⚠️ | Important but non-critical issues (Low disk space). | | error(msg, err, meta) | ERROR | ❌ | Critical failures. Triggers Discord alerts. |

Implementation Examples

const { debug, info, warn, error } = require('logsphere');

// 1. Simple Log
info("Server is listening on port 3000");

// 2. Log with Context Data (Meta)
debug("SQL Query executed", { duration: '12ms', query: 'SELECT * FROM users' });

// 3. Warning for non-blocking issues
warn("API Rate limit reached for IP: 1.2.3.4");

// 4. Critical Errors (Captures Stack Trace)
try {
  throw new Error("Payment Gateway Timeout");
} catch (err) {
  // Pass the error object as the 2nd argument to capture the full stack trace
  error("Transaction failed", err, { transactionId: 'TX_998' });
}

  • Found a bug? Open an Issue.

🏷️ Author & Maintenance

Rahul Roy Nipon

MIT License © 2026 Rahul Roy Nipon