Created
October 17, 2019 11:24
-
-
Save feelitloveit/804abf60244e9ad26bb45487bd00f685 to your computer and use it in GitHub Desktop.
Sentry.io Implement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a sentry Account | |
https://sentry.io | |
# Create a new Project | |
# choose browser => angularJS | |
# Install the depencency | |
npm install raven-js | |
# Init raven with angularjs plugin | |
# Use your project logging U RL | |
const Raven = require('raven-js'); | |
Raven | |
.config(settings.logging.sentry.url) | |
.addPlugin(require('raven-js/plugins/angular'), angular) | |
.setEnvironment(settings.environment) | |
.setRelease(settings.projectVersion) | |
.install(); | |
# Add user context when available | |
# Raven is available as depenency injection in AngularJS | |
Raven.setUserContext({ | |
username: state.user.me.username, | |
id: state.user.me.key | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
projectVersion: '#{version}', | |
environment: '#{env}', | |
logging: { | |
sentry: { | |
url: '#{sentry_url}' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment