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

hapi-bunyan

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-bunyan

Simple Bunyan logging in Hapi

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37
increased by68.18%
Maintainers
1
Weekly downloads
 
Created
Source

Hapi Bunyan

This a simple Bunyan plugin for Hapi.

Documentation

Options

  • logger (Object): Bunyan logger object
  • handler (Function, optional): custom event handler, this function can return true if it handled the event.
  • skipUndefined (Boolean, default: true): don't log events with undefined data.
  • includeData (Boolean, default: true): include data in log events.
  • mergeData (Boolean, default: false): when the event data is an object merge it into the log data.
  • includeTags (Boolean, default: false): include tags in log event.
  • joinTags (String, optional): join tags using the specified character.

Example

var bunyan = require('bunyan');
var hapi = require('hapi');

var server = new hapi.Server();
server.connection({ port: 8000 });

server.route({
  method: 'GET',
  path: '/',
  handler: function(request, reply) {
    request.log.info('just a test');

    reply({ hello: 'world' });
  },
});

var config = {
  register: require('hapi-bunyan'),
  options: {
    logger: bunyan.createLogger({ name: 'test', level: 'debug' }),
  },
};

server.register(config, function(err) {
  if (err) throw err;
});

server.start();

License

This work is licensed under the MIT License (see the LICENSE file).

Keywords

FAQs

Package last updated on 30 Jan 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