Code Monkey home page Code Monkey logo

poop's Introduction

poop Logo

hapi plugin for taking a process dump and cleaning up after an uncaught exception

Current Version Build Status

Lead Maintainer: Colin Ihrig

Table of Contents

Overview

When an uncaughtException is encountered a heap dump will be output to the plugin folder. A log file is also written containing the exception details. After this is complete the process will exit with a failure code. Heap dumps can also be taken at arbitrary times by sending a SIGUSR1 signal to the server process.

Example

The following example shows how to register and configure poop. In this example, an uncaught exception is thrown after poop is registered. This will trigger a heap dump and poop.log file to be created.

'use strict';
var Path = require('path');
var Hapi = require('hapi');
var Poop = require('poop');
var server = new Hapi.Server();

server.register({
    register: Poop,
    options: {
        logPath: Path.join(__dirname, 'poop.log')
    }
}, function () {

    throw new Error('uncaught');
});

Settings

The following options are available when configuring poop.

logPath

The file path to log any uncaught exception errors. Defaults to poop.log in the plugin folder.

writeStreamOptions

Options passed to the write stream of the log file. Uses Node's defaults:

{
    flags: 'w',
    encoding: null,
    fd: null,
    mode: 0666
}

poop's People

Contributors

cjihrig avatar geek avatar arb avatar lloydbenson avatar clohr avatar

Watchers

James Cloos avatar Xander avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.