Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/log4js-node/redis
Redis appender for log4js-node
https://github.com/log4js-node/redis
Last synced: 2 months ago
JSON representation
Redis appender for log4js-node
- Host: GitHub
- URL: https://github.com/log4js-node/redis
- Owner: log4js-node
- License: apache-2.0
- Created: 2018-06-03T22:06:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-20T07:07:20.000Z (over 1 year ago)
- Last Synced: 2024-09-19T08:47:47.691Z (4 months ago)
- Language: JavaScript
- Size: 544 KB
- Stars: 5
- Watchers: 4
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Redis Appender for log4js-node
Stores log events in a [Redis](https://redis.io) database. Plugin for log4js > 2.x
```bash
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](layouts.md)).The appender will use the Redis PUBLISH command to send the log event messages to the channel.
## Example
```javascript
log4js.configure({
appenders: {
redis: { type: '@log4js-node/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`.