server-base-log

7.1.32 • Public • Published

server base pino logger

simple wrapper for pino used by server-base

js-standard-style build status downloads

usage

const log = require('server-base-log')(__filename, { optional pino options })

log.info('ok')

info, fatal, debug, error, trace and warn are bound to correct t.equal for convenience.

log options

All options are passed to pino

opt.pretty options are passed to pino.pretty constructor

default log options are

  safe: true,
  serializers: {
    req: pino.stdSerializers.req,
    res: pino.stdSerializers.res,
    q: pino.stdSerializers.req,
    r: pino.stdSerializers.res
  }

http request logging

Both log.info({ q, r }) and log.info({ req, res }) work.

env

setting process.env.LOG_PRETTY uses pino.pretty

setting process.env.LOG_LEVEL overrides the default log level which is debug

install

With npm do:

npm install server-base-log

license

Apache License, Version 2.0

Package Sidebar

Install

npm i server-base-log

Weekly Downloads

138

Version

7.1.32

License

Apache-2.0

Unpacked Size

25.6 kB

Total Files

4

Last publish

Collaborators

  • jameskyburz