0.7.0 • Published 8 years ago

hapi-bunyan v0.7.0

Weekly downloads
342
License
MIT
Repository
github
Last release
8 years ago

Hapi Bunyan Build Status

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

0.7.0

8 years ago

0.6.0

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago