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

bitbucket-logging

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitbucket-logging

A logging handler for NodeJS that opens BitBucket issues on provided exception. Forked on https://github.com/valeriansaliou/node-gitlab-logging

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Node BitBucket Logging

Node BitBucket Logging is a custom log issue handler that has been written with the purpose of auto-opening (and assigning) issues on BitBucket everytime something goes south with NodeJS code.

Useful for production deployments, where you want to track the issues directly from BitBucket, not from a dark server log file.

Node BitBucket Logging is smart enough to recognize similar errors, thus not opening blindly a new issue everytime.

Setup

  • Add bitbucket-logging to your package.json dependencies.

  • Then, require and configure the module using the code below:

bitbucket_logging = require('bitbucket-logging');

/* GitLab options */
bitbucket_logging.configure({
    //Required
    slug:"PROJECT_NAME",
    owner:"OWNER",
    username:"USERNAME",
    password:"PASSWORD",

    // Optional
    environment: 'production'           // The NodeJS environment in use, useful when you pre-process the NODE_ENV value
});
  • Then, when you need to handle an error, just call:
// Boom, the error variable value will be redirected to your Bitbucket issues tracker!
bitbucket_logging.handle(error, callback);
  • If you need to catch all unhandled errors (which is recommended!), use the following code:
process.on('uncaughtException', function(error) {
    var error_message = error.stack || error;

    // Log to console
    console.error('uncaughtException', error_message);

    // Pipe error to Bitbucket
    bitbucket_logging.handle(error_message, function{
        // Recommended: kill the NodeJS process (restart a clean one via forever)
        process.exit(1);
    });
});
  • Enjoy!

Notes

  • This module is based on https://github.com/valeriansaliou/node-gitlab-logging , Valerian Saliou.
  • This module is in production in the Yool Core Yool

FAQs

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