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

hapi-ot-logger

Package Overview
Dependencies
Maintainers
1
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.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by166.67%
Maintainers
1
Weekly downloads
 
Created
Source

#Hapi-ot-logger Build Status NPM version Dependencies

Hapi plugin for ot-logging standards.

Currently only supports redis.

installation:

npm install hapi-ot-logger

usage:

var hapi = require("hapi");

var server = Hapi.createServer('127.0.0.1', 3000, {});

server.pack.register([
  {
    plugin: require('hapi-ot-logger'),
    options: {
      servicetype: "myservice",
      versions: { // defaults to v1
        request: 'v2',
        log: 'v3',
        error: 'v2'
      },
      redis: {
        host: '127.0.0.1',
        port: 6379,
        listname: 'logs'
      },
      console: true, // optional console output for debugging, default: false
      payload: false, // include the request payload (request.payload stringified), default: false
      validate: function(log) { // validates that a message should be logged (default to always valid)
        return log.logname === 'request' && log.headers['user-agent'] !== 'noisy-spider';
      }
    }
  }], function(err){
    if(err){
      throw err;
    }

    server.start(function(){
      server.log('server started');
    });
});

Keywords

FAQs

Package last updated on 14 Dec 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