How to use the rollbar.init function in rollbar

To help you get started, we’ve selected a few rollbar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WhatAKitty / react-script-antd-pro / src / rollbar.js View on Github external
import Rollbar from 'rollbar';

// Track error by rollbar.com
if (location.host === 'preview.pro.ant.design') {
  Rollbar.init({
    accessToken: '033ca6d7c0eb4cc1831cf470c2649971',
    captureUncaught: true,
    captureUnhandledRejections: true,
    payload: {
      environment: 'production',
    },
  });
}
github xjchenhao / egg-admin-service / client-old / src / rollbar.js View on Github external
import Rollbar from 'rollbar';

// Track error by rollbar.com
if (location.host === 'preview.pro.ant.design') {
  Rollbar.init({
    accessToken: '033ca6d7c0eb4cc1831cf470c2649971',
    captureUncaught: true,
    captureUnhandledRejections: true,
    payload: {
      environment: 'production',
    },
  });
}
github Alexcn / OneStack / apps / static / src / rollbar.js View on Github external
import Rollbar from 'rollbar';

// Track error by rollbar.com
if (location.host === 'preview.pro.ant.design') {
  Rollbar.init({
    accessToken: '033ca6d7c0eb4cc1831cf470c2649971',
    captureUncaught: true,
    captureUnhandledRejections: true,
    payload: {
      environment: 'production',
    },
  });
}
github saikat / react-apollo-starter-kit / src / log.js View on Github external
let logInstance = null

if (isClient()) {
  minilog.enable()
  logInstance = minilog('client')
  const existingErrorLogger = logInstance.error
  logInstance.error = (err) => {
    window.Rollbar.error(err)
    existingErrorLogger(err)
  }
} else {
  let enableRollbar = false
  if (process.env.NODE_ENV === 'production') {
    enableRollbar = true
    rollbar.init(process.env.ROLLBAR_ACCESS_TOKEN)
    const options = {
      exitOnUncaughtException: false
    }
    rollbar.handleUncaughtExceptions(process.env.ROLLBAR_ACCESS_TOKEN, options)
  }

  minilog.suggest.deny(/.*/, process.env.NODE_ENV === 'development' ? 'debug' : 'debug')

  minilog.enable()
    .pipe(minilog.backends.console.formatWithStack)
    .pipe(minilog.backends.console)

  logInstance = minilog('backend')
  const existingErrorLogger = logInstance.error
  logInstance.error = (err) => {
    existingErrorLogger(err.stack ? err.stack : err)
github Runnable / hipcheck / lib / Hipcheck.js View on Github external
var redisHostSplit = options.redis.split(':');
  options.redisHostname = redisHostSplit[0];
  options.redisPort = redisHostSplit[1];
  options.redisOpts = {
    auth_pass: options.redisPassword
  };

  this.redis = require('redis').createClient(
    options.redisPort,
    options.redisHostname,
    options.redisOpts
  );
  this.redis.on('error', throwError.bind(null, 'Redis Connection Error'));
};

rollbar.init('34dfc593cf14456985c66ffc12c6acc4');
rollbar.reportMessage('heyyyy', 'warn');
github heroku / awsdetailedbilling / import_specific.js View on Github external
var util = require('util');
var log = require('loglevel');
var ArgumentParser = require('argparse').ArgumentParser;
var rollbar = require('rollbar');
var moment = require('moment');

var BaseParser = require('./lib/baseparser.js');
var DBR = require('./lib/dbr.js');
var Redshift = require('./lib/redshift.js');
var cliUtils = require('./lib/cliutils.js');


rollbar.init(process.env.ROLLBAR_TOKEN, {environment: process.env.ROLLBAR_ENVIRONMENT});


var parser = new BaseParser({
  version: '0.0.1',
  addHelp: true,
  description: "Imports a specific detailed billing report to the line_items table."
});

parser.addArgument(
  ['--force'], {
    action: 'storeConst',
    dest: 'force',
    help: 'Ignore and overwrite an existing staged DBR.',
    constant: true
  }
);
github neighbourhoodie / voice-of-interconnect / hoodie / server / rollbar.js View on Github external
function rollbar (server, options, next) {
  if (process.env.ROLLBAR_ACCESS_TOKEN) {
    const rollbar = require('rollbar')
    rollbar.init(process.env.ROLLBAR_ACCESS_TOKEN, {
      env: process.env.NODE_ENV
    })
    rollbar.handleUncaughtExceptionsAndRejections(process.env.POST_SERVER_ITEM_ACCESS_TOKEN, {
      exitOnUncaughtException: true
    })

    server.on('log', (event, tags) => {
      if (!tags.error) {
        return
      }

      rollbar.reportMessage(event.data)
    })
  }

  next()
github tegon / traktflix / src / class / Rollbar.js View on Github external
async init() {
    if (typeof this._rollbar !== `undefined`) {
      return this;
    }
    const storage = await BrowserStorage.get(`options`);
    if (storage.options && storage.options.allowRollbar && (await browser.permissions.contains({ origins: [`*://api.rollbar.com/*`] }))) {
      this._rollbar = RollbarSdk.init(this._config);
      window.Rollbar = this._rollbar;
      this.error = this._rollbar.error.bind(this._rollbar);
      this.warning = this._rollbar.warning.bind(this._rollbar);
    }
    return this;
  }
github heroku / awsdetailedbilling / import_month_to_date.js View on Github external
/*******************************************************************************
Import month-to-date DBRs, overwriting the existing month-to-date.
*******************************************************************************/

var util = require('util')

var log = require('loglevel')
var rollbar = require('rollbar')
var moment = require('moment')

var BaseParser = require('./lib/baseparser.js')
var DBR = require('./lib/dbr.js')
var Redshift = require('./lib/redshift.js')
var cliUtils = require('./lib/cliutils.js')

rollbar.init(process.env.ROLLBAR_TOKEN, {environment: process.env.ROLLBAR_ENVIRONMENT})
rollbar.handleUncaughtExceptions(process.env.ROLLBAR_TOKEN,
                                 {exitOnUncaughtException: true})

var parser = new BaseParser({
  version: '0.0.1',
  addHelp: true,
  description: 'Imports month-to-date detailed billing reports'
})

parser.addArgument(
  ['--no-stage'], {
    action: 'storeConst',
    dest: 'no_stage',
    help: 'Use an existing staged month-to-date DBR.',
    constant: true
  }
github maxbeatty / passplum / lib / monitor.js View on Github external
Joi.validate(options, schema, (err) => {

        if (err) {
            return next(err);
        }

        Rollbar.init(options.rollbar.accessToken, {
            environment: options.env
        });

        Rollbar.handleUncaughtExceptionsAndRejections(options.rollbar.accessToken, {
            exitOnUncaughtException: true
        });

        plugin.on('request-error', (request, err) => {

            Rollbar.handleError(err, request);
        });

        return next();
    });
};