npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

restify-pino-logger

v3.0.0

Published

pino logging restify middleware

Downloads

1,081

Readme

restify-pino-logger  Build Status

pino logging restify middleware

To our knowledge, restify-pino-logger is the fastest restify logger in town.

Benchmarks

Benchmarks log each request/response pair while returning 'hello world', using autocannon with 100 connections and 10 pipelined requests (autocannon -c 100 -p 10 http://localhost:3000).

  • restify.auditLogger + bunyan: 5483.82 req/sec
  • restify-bunyan-logger: 6306.73 req/sec
  • restify-logger: 7485.28 req/sec
  • restify-pino-logger: 8207.46 req/sec
  • restify-pino-logger (extreme): 8789.28 req/sec
  • restify-pino-logger (without restify): 22240.73 req/seq
  • restify-pino-logger (without restify and extreme): 25536 req/sec

All benchmarks where taken on a Macbook Pro 2013 (2.6GHZ i7, 16GB of RAM).

Whilst we're comparing restify-pino-logger against restify-logger this isn't really a fair contest.

restify-logger sits on top of morgan.

Morgan doesn't support logging arbitrary data, nor does it output JSON. Further Morgan uses a form of eval to achieve high speed logging. Whilst probably safe, using eval at all tends to cause concern, particular when it comes to server-side JavaScript.

The fact that restify-pino-logger achieves higher throughput with JSON logging and arbitrary data, without using eval, serves to emphasise the high-speed capabilities of restify-pino-logger.

With restify-pino-logger you can have features, safety and speed.

Install

npm i restify-pino-logger --save

Example

'use strict'

var restify = require('restify')
var server = restify.createServer({name: 'app'})

server.use(require('restify-pino-logger')())

server.get('/', function (req, res) {
  req.log.info('something else')
  res.send('hello world')
})

server.listen(3000)
$ node example.js | pino
[2016-04-20T20:50:01.260Z] INFO (11809 on MacBook-Pro-4.local): something else
    req: {
      "id": 1,
      "method": "GET",
      "url": "/",
      "headers": {
        "host": "localhost:3000",
        "user-agent": "curl/7.43.0",
        "accept": "*/*"
      },
      "remoteAddress": "::1",
      "remotePort": 55295
    }
[2016-04-20T20:50:01.267Z] INFO (11809 on MacBook-Pro-4.local): request completed
    res: {
      "statusCode": 200,
      "header": "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nContent-Length: 13\r\nDate: Wed, 20 Apr 2016 20:50:01 GMT\r\nConnection: keep-alive\r\n\r\n"
    }
    responseTime: 8
    req: {
      "id": 1,
      "method": "GET",
      "url": "/",
      "headers": {
        "host": "localhost:3000",
        "user-agent": "curl/7.43.0",
        "accept": "*/*"
      },
      "remoteAddress": "::1",
      "remotePort": 55295
    }

API

restify-pino-logger has the same options of pino, look at them there. restify-pino-logger attaches some listeners to the request, so that it will log when the request is completed.

License

MIT