JavaScript logging libraries

Updated Nov 2026

JavaScript logging libraries record what an application does as it runs, from debug messages to structured events with severity levels. A logger writes each record to a destination such as the console, a file, or a telemetry pipeline. These libraries give developers the records they need to trace errors in production services.

Popularity

debug has the most monthly downloads in this comparison, at 3.7B.

LibraryMonthly downloadsStarsLast releaseLicense
debug
3.7B
11.5KSep 2025MIT
obug
623.4M
92Sep 2026MIT
@opentelemetry/sdk-logs
322.0M
3.5KNov 2026Apache-2.0
pino
300.7M
18.3KOct 2026MIT
consola
260.6M
7.3KMar 2025MIT
Sentry Node SDK
217.2M
8.8KNov 2026MIT
winston
141.2M
24.5KDec 2025MIT
loglevel
126.9M
2.7KSep 2024MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Provides a debugging utility for Node.js and the browser.

Downloads / mo
3.7B
Stars
11.5K
Last release
4.4.3
License
MIT

Quickstart

From README.md
$ npm install debug
const debug = require('debug')('app');
debug('hello');

debug examples

From open-source projects on GitHub

Forks debug with TypeScript and ESM support.

Downloads / mo
623.4M
Stars
92
Last release
3.0.0
License
MIT

Quickstart

From README.md
$ npm install obug
import { createDebug } from 'obug';
const debug = createDebug('app');
debug('hello');

obug examples

From open-source projects on GitHub

@opentelemetry/sdk-logs

Provides the OpenTelemetry SDK for log records.

Downloads / mo
322.0M
Stars
3.5K
Last release
3.1.1
License
Apache-2.0

Quickstart

From README.md
$ npm install @opentelemetry/api @opentelemetry/sdk-logs
const { SeverityNumber } = require('@opentelemetry/api');
const { LoggerProvider, SimpleLogRecordProcessor, ConsoleLogRecordExporter } = require('@opentelemetry/sdk-logs');
const provider = new LoggerProvider({
  processors: [new SimpleLogRecordProcessor({ exporter: new ConsoleLogRecordExporter() })],
});
const logger = provider.getLogger('example');
logger.emit({ severityNumber: SeverityNumber.INFO, body: 'hello' });

@opentelemetry/sdk-logs examples

From open-source projects on GitHub

Writes JSON log lines with configurable levels and contextual child loggers.

Downloads / mo
300.7M
Stars
18.3K
Last release
10.4.0
License
MIT

Strengths

  • Redacts selected object fields. Configure redaction paths to censor or remove selected values.
  • Binds context through child loggers. Attach shared fields to every log line from a child logger.

Limitations

  • Redaction paths are case sensitive. Match each field name’s exact casing in redaction paths.
  • Multistream needs the lowest threshold. Set the parent level low enough for every destination’s required messages.

Quickstart

From README.md
$ npm install pino
const logger = require('pino')();
logger.info('hello world');

pino examples

From open-source projects on GitHub

Wraps the built-in console.

Downloads / mo
260.6M
Stars
7.3K
Last release
3.4.2
License
MIT

Quickstart

From README.md
$ npm install consola
import { consola } from 'consola';
consola.info('hello');

consola examples

From open-source projects on GitHub

Sentry Node SDK

Provides the Sentry SDK for Node.js, with OpenTelemetry for performance instrumentation.

Downloads / mo
217.2M
Stars
8.8K
Last release
11.14.0
License
MIT

Quickstart

From Core API
$ npm install @sentry/node
import * as Sentry from '@sentry/node';
Sentry.init({ dsn: process.env.SENTRY_DSN });
Sentry.logger.info('hello');

Routes log events through configurable formats and transports.

Downloads / mo
141.2M
Stars
24.5K
Last release
3.19.0
License
MIT

Strengths

  • Combines multiple transports. Send one logger’s events to multiple destinations with separate thresholds.
  • Defines application-specific severity levels. Configure custom logging levels when creating a logger.

Limitations

  • Default logger needs configured transports. Add transports before using the default logger to avoid buffered log buildup.

Quickstart

From README.md
$ npm install winston
const winston = require('winston');
const logger = winston.createLogger({
  format: winston.format.json(),
  transports: [new winston.transports.Console()],
});
logger.info('hello');

Adds log level methods to the available console.log methods.

Downloads / mo
126.9M
Stars
2.7K
Last release
1.9.2
License
MIT

Quickstart

From README.md
$ npm install loglevel
const log = require('loglevel');
log.setLevel('info');
log.info('hello');

loglevel examples

From open-source projects on GitHub

FAQ

Pino suits Node.js services that write structured JSON logs. Winston suits apps that route logs to several destinations with separate formats. debug suits libraries that print diagnostics only when a namespace is enabled.

Pino writes JSON log lines with child loggers that add context to each record. Winston routes each log event through configurable formats and multiple transports.

Consola is a console wrapper for human-facing CLI logs. Custom reporters change how it prints or serializes each log object.

loglevel adds log level methods to any available console.log method. It supports named loggers with severity filtering.

The Sentry Node SDK captures log records through its logger methods or its logging integrations.

For coding agents

Found your logging library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official