Collecting logs from Node.js applications
The LogDoc Node.js SDK with Winston and Pino support. Asynchronous log delivery that never blocks the event loop. Compatible with Express, Fastify, NestJS and other frameworks.
Terminal — Installation
$ npm install logdoc-node # or with yarn $ yarn add logdoc-node
app.js — Winston integration
const { LogDocTransport } = require('logdoc-node');
const winston = require('winston');
const logger = winston.createLogger({
transports: [
new LogDocTransport({
host: 'logdoc-server',
port: 12345,
source: 'web-frontend'
})
]
});
logger.info('Request processed', {
userId: 'usr-123',
duration: 45
});
Highlights
•Non-blocking delivery — logging never slows down your app's event loop
•Winston and Pino compatibility via transport adapters
•Automatic metadata capture: hostname, PID, Node.js version