npm install pino-redis
Write logs into redis
node my-app.js | pino-redis [options]
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)
Usage: pino-redis [options]
Load pino logs into Redis
Options:
-h, --help output usage information
-V, --version output the version number
-U, --connectionUrl <url> redis connection url
meta
(object)key
(string): Required. Key will hold the string value.ttl
(number): Setkey
to timeout after a given number of seconds. Default60
gzip
(boolean): Use gzip to compress before log into redis. Defaultfalse
Licensed under MIT.