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

hapi-ot-logger

Package Overview
Dependencies
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-ot-logger

logger conforming to ot standards

  • 3.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

hapi-ot-logger

OpenTable standard-compliant logging plugin for Hapi.

Build Status Dependency Status devDependency Status npm version

Usage

$ npm i hapi-ot-logger --save
var server = new (require('hapi').Server)();
server.connection({ port: 3000 });

server.register([
    {
        register: require('hapi-ot-logger'),
        options: {
          servicetype: "myservice",
          versions: {
            request: 'v2',
            log: 'v3',
            error: 'v2'
          },
          redis: {
            host: '127.0.0.1',
            port: 6379,
            listname: 'logs'
          },
          console: true,
          payload: false,
          validate: function(log) {
            return log.logname === 'request' && log.headers['user-agent'] !== 'noisy-spider';
          },
          preSend: function(req, log) {
            log.customAttribute = req.context.someAttribute;
          }
        }
    }
], function (err) {
    if (err) {
        console.error('Failed to load plugin:', err);
    }

    server.start();
});

Configuration

  • servicetype - unique service type
  • versions -
    • request - request log version
    • log - diagnostic log version
    • error - error log version
  • redis
    • host - redis server hostname or IP address
    • port - redis server port
    • listname - redis list name
  • console - (optional) enable console output for debugging
  • payload - (optional) include request payload
  • validate - (optional) validates that a message should be logged
  • preSend - (optional) enables modification of log message

Release History

  • v3.2.1 (2016-08-19)
    • disable plugin option validation as it is a breaking change
  • v3.2.0 (2016-08-18)
    • added optional preSend(req, log) function to enable modification of log message
  • v3.1.0 (2015-11-14)
    • ???

Keywords

FAQs

Package last updated on 19 Aug 2016

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