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

loglog-core

v1.4.0

Published

A scalable, framework-agnostic logging system with built-in support for various frameworks

Readme

LogLog - Advanced Logging System

A scalable, framework-agnostic logging system with built-in support for Express.js and Next.js, featuring environment-specific configurations for both client and server-side logging.

Features

  • Environment-specific configurations (development, staging, production)
  • Client-side and server-side logging support
  • Remote logging for client-side
  • File rotation for server-side
  • Framework-specific adapters (Express.js, Next.js)
  • Structured logging with JSON support
  • Sensitive data redaction
  • OpenTelemetry integration
  • Performance timing
  • Colorized console output

Installation

Choose your preferred package manager:

# Using npm
npm install loglog-core

# Using yarn
yarn add loglog-core

# Using pnpm
pnpm install loglog-core

For CLI usage, install globally:

# Using npm
npm install -g loglog-core

# Using yarn
yarn global add loglog-core

# Using pnpm
pnpm add -g loglog-core

CLI Commands

LogLog comes with a command-line interface that helps you manage and analyze your logs. Install globally to use the CLI:

npm install -g loglog-core

Available commands:

# Initialize LogLog configuration in your project
loglog init

# View real-time log stream with optional filtering
loglog tail [--level=<level>] [--format=json|text] [--filter=<pattern>]

# Search through log files
loglog search <pattern> [--from=<date>] [--to=<date>] [--level=<level>]

# Rotate log files manually
loglog rotate

# View log statistics and summaries
loglog stats [--from=<date>] [--to=<date>]

# Validate LogLog configuration
loglog validate

# Clear log files (with confirmation)
loglog clear [--older-than=<days>]

CLI Examples

# Watch INFO and above logs in real-time
loglog tail --level=info

# Search for error logs from last 24 hours
loglog search "error" --from="24h"

# View log statistics for the current month
loglog stats --from="1M"

# Rotate logs that are older than 7 days
loglog rotate --older-than=7

# Clear all logs older than 30 days
loglog clear --older-than=30

Basic Usage

Server-Side Logging

import { Logger, LogLevel } from 'loglog-core';

const logger = new Logger({
  environment: process.env.NODE_ENV || 'development',
  serverConfig: {
    enableConsole: true,
    enableFile: true,
    level: LogLevel.INFO,
    logDir: 'logs'
  }
});

logger.info('Server started', { port: 3000 });
logger.error('Error occurred', new Error('Something went wrong'));

Client-Side Logging

import { Logger, LogLevel } from 'loglog-core';

const logger = new Logger({
  environment: process.env.NODE_ENV || 'development',
  clientConfig: {
    enableConsole: true,
    enableFile: false,
    enableRemote: true,
    remoteEndpoint: '/api/logs',
    level: LogLevel.INFO,
    structured: true,
    colorize: true,
    timestamp: true,
    labels: {
      app: 'my-client-app'
    }
  }
});

logger.info('Application initialized', { version: '1.0.0' });

Framework Integration

For detailed framework-specific integration guides, please refer to:

Advanced Features

Context Propagation

const logger = new Logger();

// Add context that will be included in all subsequent logs
const userLogger = logger.withContext({ userId: '123' });
userLogger.info('Processing user'); // Includes userId in context

Performance Timing

const logger = new Logger();

// Automatically time async operations
const result = await logger.time(
  'Database query completed',
  async () => await db.query('SELECT * FROM users'),
  { operation: 'user_query' }
);

Cleanup

const logger = new Logger();

// Clean up resources and flush pending logs
await logger.cleanup();

Creating Custom Adapters

import { LoggingAdapter, Logger, RequestInfo, ResponseInfo } from 'loglog-core';

export class CustomAdapter implements LoggingAdapter {
  initialize(logger: Logger): void {
    // Initialize adapter
  }

  createRequestLogger(requestInfo: RequestInfo): Logger {
    // Create request-specific logger
  }

  logRequest(logger: Logger, requestInfo: RequestInfo): void {
    // Log request details
  }

  logResponse(logger: Logger, responseInfo: ResponseInfo): void {
    // Log response details
  }
}