GithubHelp home page GithubHelp logo

classicvalues / ember-cli-sentry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ember-cli-sentry/ember-cli-sentry

0.0 1.0 0.0 598 KB

Add support for Sentry to Ember.js

Home Page: http://damiencaselli.github.io/ember-cli-sentry/

License: MIT License

JavaScript 89.81% HTML 9.60% CSS 0.59%

ember-cli-sentry's Introduction

ember-cli-sentry

An ember-cli addon adding Sentry support.

Docs are available here.

What it does (and does not)

This addon does:

  • Enable safe use of Raven.js whether you are in development mode or not.
  • Inject a logging service to routes, components, controllers and models to access Raven object.
  • Provide a default logger generator that should work for the vast majority of people.
  • Provide raven-js in browser.
  • Provide rather complete customization.

This addon does not:

  • Generate the logging service for you.
  • Provide a Sentry key for testing.

Install

ember install ember-cli-sentry

Note: Since v3.0.0, raven-js package is automatically included by this addon.

Configuration

TLDR

// config/environment.js

module.exports = function(environment) {
  var ENV = {

    /* config */

    sentry: {
      dsn: 'https://<dummykey>@app.getsentry.com/<dummyproject>'
    }
  }
}

Complete config

// config/environment.js

module.exports = function(environment) {
  var ENV = {

    /* config */

    sentry: {
      /**
       * The only mandatory parameter.
       *
       * @type {String}
       */
      dsn: 'https://<dummykey>@app.getsentry.com/<dummyproject>',

      /**
       * Sets Raven.debug property when running `Raven.config`.
       *
       * @type {Boolean}
       * @default true
       */
      debug: true,

      /**
       * If set to true, it will prevent Raven.js from being initialized.
       * Errors and logs will be logged to the console (default) instead of
       * being reported by Raven.
       *
       * @type {Boolean}
       * @default undefined
       */
      development: false,

      /**
       * If set to true, addon will try to have Ember.onerror
       * and Ember.RSVP.on('error') captured by Raven.
       *
       * @type {Boolean}
       * @default true
       */
      globalErrorCatching: true,

      /**
       * Raven.js option.
       *
       * @type {Array}
       * @default []
       */
      includePaths: [],

      /**
       * Raven.js option.
       *
       * @type {Array}
       * @default []
       */
      whitelistUrls: [],

      /**
       * Options to pass directly to Raven.js. Note: whitelistUrls and
       * includePaths in this will take precedence
       * over the above.
       *
       * @default {}
       */
      ravenOptions: {},
    }
  }
}

Content Security Policy

To allow Ravenjs to work properly, you need to add a couple of thing to the content security policy rules:

'script-src': "'self' 'unsafe-inline' 'unsafe-eval'",
'img-src': "data: app.getsentry.com",
'connect-src': "'self' app.getsentry.com"

Meaningless stack traces?

See this issue.

Example

The dummy application in tests is a working example with a couple of logging here and there, and a default logger.

Dependencies

Raven.js

Licence

MIT

ember-cli-sentry's People

Contributors

dashdashzako avatar turbo87 avatar marcoow avatar tchak avatar kkumler avatar gabz75 avatar dschmidt avatar xcambar avatar mazondo avatar rwjblue avatar mattmcmanus avatar hussfelt avatar achambers avatar seriousben avatar grantcupps avatar jakehow avatar buschtoens avatar oquis avatar tim-evans avatar ember-tomster avatar floqqi avatar

Watchers

 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.