Skip to content

anhthang/pino-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pino-redis

Load pino logs into Redis.

npm download dependents

Install

npm install pino-redis

Usage

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)

Options

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

.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.

About

load pino logs intro redis

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published