ioredis icon indicating copy to clipboard operation
ioredis copied to clipboard

[Feature Request] Implement a Logger system

Open emaugere-polyconseil opened this issue 3 years ago • 3 comments

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.

emaugere-polyconseil avatar Feb 03 '22 10:02 emaugere-polyconseil

knex example:

  • https://knexjs.org/guide/#log
const knex = require('knex')({
  log: {
    warn(message) {
    },
    error(message) {
    },
    deprecate(message) {
    },
    debug(message) {
    },
  }
});

glensc avatar Jun 10 '22 11:06 glensc

Also would love to see this.

RareBodhi avatar Nov 16 '22 05:11 RareBodhi

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.

checkmatez avatar Oct 03 '23 11:10 checkmatez