@log4js-node/redis
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Redis Appender for log4js-node

Stores log events in a Redis database. Plugin for log4js > 2.x

npm install @log4js-node/redis

Configuration

  • type - redis
  • host - string (optional, defaults to 127.0.0.1) - the location of the redis server
  • port - integer (optional, defaults to 6379) - the port the redis server is listening on
  • pass - string (optional) - password to use when authenticating connection to redis
  • channel - string - the redis channel that log events will be published to
  • layout - object (optional, defaults to messagePassThroughLayout) - the layout to use for log events (see layouts).

The appender will use the Redis PUBLISH command to send the log event messages to the channel.

Example

log4js.configure({
  appenders: {
    redis: { type: 'redis', channel: 'logs' }
  },
  categories: { default: { appenders: ['redis'], level: 'info' } }
});

This configuration will publish log messages to the logs channel on 127.0.0.1:6379.

Package Sidebar

Install

npm i @log4js-node/redis

Weekly Downloads

610

Version

1.0.0

License

Apache-2.0

Unpacked Size

16.4 kB

Total Files

5

Last publish

Collaborators

  • lamweili
  • csausdev