https://github.com/anhthang/pino-redis
load pino logs intro redis
https://github.com/anhthang/pino-redis
logger pino pino-redis redis
Last synced: 15 days ago
JSON representation
load pino logs intro redis
- Host: GitHub
- URL: https://github.com/anhthang/pino-redis
- Owner: anhthang
- License: mit
- Created: 2017-02-26T10:04:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-02T18:33:13.000Z (over 1 year ago)
- Last Synced: 2025-04-10T11:37:40.677Z (17 days ago)
- Topics: logger, pino, pino-redis, redis
- Language: JavaScript
- Size: 17.6 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pino-redis
Load [pino](https://github.com/pinojs/pino) logs into [Redis](https://redis.io).
[](https://npmjs.com/package/pino-redis)  
## Install
```
npm install pino-redis
```## Usage
Write logs into redis
```
node my-app.js | pino-redis [options]
``````javascript
var pinoRedis = require('pino-redis')({
connectionUrl: `your redis connection url`
})var pino = require('pino')
var logger = pino(pinoRedis)var message = 'load pino logs into redis',
meta = {ttl: 60, key: 'redis:pino', child: 'logger'}logger.info(meta, message)
```
## Options
```
Usage: pino-redis [options]Load pino logs into Redis
Options:
-h, --help output usage information
-V, --version output the version number
-U, --connectionUrl redis connection url
```
## .pino([meta], message)### Parameters:
+ `meta` (object)
* `key` (string): Required. Key will hold the string value.
* `ttl` (number): Set `key` to timeout after a given number of seconds. Default `60`
* `gzip` (boolean): Use gzip to compress before log into redis. Default `false`## License
Licensed under [MIT](./LICENSE).