Menu

1 / 2

GitHub - nodejs/logger

GitHub Public Timeline Feed·nodejs·5 days ago
#dhJAuYkM
Reading 0:00
15s threshold

A structured logging facade for Node.js with pluggable providers.

A logger composes structured log events and passes them to a provider. Providers decide what to do with them: filtering, encoding, buffering, and output. Libraries can log through a logger without deciding where their logs go, and applications choose the provider.

Warning

This module is under active development. Until 1.0.0, breaking changes may happen in minor releases.

Installation

npm install @nodejs/logger

Node.js 24.6.0 or later is required.

Usage

<div dir="auto" data-snippet-clipboard-copy-content="const create = require('@nodejs/logger');

const logger = create({ name: 'app' }); logger.info('server started', { port: 3000 }); // {"attributes":{"port":3000},"bindings":{},"level":{"name":"info","value":30}, // "message":"server started","name":"app","timestamp":1791280457128}"> const create = require ( '@nodejs/logger' ) ;

const logger = create ( { name : 'app' } ) ; logger .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.