winston-limit-transport
A logger transport for winston limiting same messages in logs.
Reducing your cost and readability in your loggers.
Install
yarn add @redpill-paris/winston-limit-transport
Configuration
const winston = require('winston');
const WinstonLimit = require('@redpill-paris/winston-limit-transport');
const logger = winston.createLogger({
level: 'debug',
transports: [
new WinstonLimit({
timeout: 500,
transport: new winston.transports.Console({
handleExceptions: true,
}),
}),
],
});
logger.info('Logger init finish');
TODO
- Include metadata in the hash of the limiter(Only the message is compared to previous logs)
- Emit to a stream when a log is limited