Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-bunyan-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-bunyan-plugin

A Hapi.js plugin for passing all logging through bunyan.

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Hapi Bunyan Plugin

Integrates bunyan with Hapi.js by wiring a bunyan Logger instance into the published server events.

Allows structured json logging of the Hapi.Server generated log messages. Using server.log() and request.log() will be routed through the bunyan Logger as well.

Usage

var Hapi = require('hapi'),
    HapiBunyan = require('hapi-bunyan'),
    bunyan = require('bunyan');

var server = new Hapi.Server(),
    log = bunyan.createLogger({
        name: 'my-application',
        level: 'debug'
    });

server.connection({ port: 8000 });

server.register({
    register: HapiBunyan,
    options: {
        log: log
    }
});

// other server configuration, routes, etc.

server.start();

Configuration

The options object used when registering the plugin takes the following properties:

  • log - the bunyan Logger instance. (required)
  • logInternal - boolean value, defaults to false. Set to true to enable logging of Hapi.Server internal events.

License

MIT. See LICENSE.txt.

FAQs

Package last updated on 21 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc