redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.23k stars 1.19k forks source link

[Feature Request] Implement a Logger system #1503

Open emaugere-polyconseil opened 2 years ago

emaugere-polyconseil commented 2 years ago

Hello,

We are using IORedis as our internal library to connect to our redis server. We also have a Postgresql server we connect to using TypeORM. With the TypeORM library, we have an extended logging system thanks to their Logger module (https://github.com/typeorm/typeorm/blob/master/docs/logging.md#using-custom-logger).

We think it would be great to also have a similar logger module to use with IORedis.

The use case for this Logger module is to allow the user to implement custom log modules. We use the TypeORM custom logger to connect to the Wiston Logger module, for example.

glensc commented 2 years ago

knex example:

const knex = require('knex')({
  log: {
    warn(message) {
    },
    error(message) {
    },
    deprecate(message) {
    },
    debug(message) {
    },
  }
});
RareBodhi commented 1 year ago

Also would love to see this.

checkmatez commented 11 months ago

If a library produces logs, then it should allow logger customization by library consumers.

+1 for feature request. We want to use pino-logger and make sure that all output have the same format - line-delimited JSON.