Kickass Rollbar integration for Meteor projects.
- Run
meteor add saucecode:rollbar
- Set
'ROLLBAR_SERVER_ACCESS_TOKEN'
, and optionally'ROLLBAR_CLIENT_ACCESS_TOKEN'
(if you want to enable the browserJS rollbar reporter) and also optionally, the'ROLLBAR_ENVIRONMENT'
environment variables with your client and server access tokens for rollbar - Run meteor
E.g.
$ meteor add saucecode:rollbar
$ ROLLBAR_SERVER_ACCESS_TOKEN=acefaketoken1 ROLLBAR_CLIENT_ACCESS_TOKEN=acefaketoken2imsocreative ROLLBAR_ENVIRONMENT=development meteor
You have all the inbuilt rollbar node functions available on the server through the namespace rollbar
.
We have also built in two really simple and useful functions for logging errors from either the client or the server.
- String(Mandatory): message to log to rollbar via the API.
- Object(Optional): each key-value pair will be reported in the same rollbar item. Useful for adding more context to your errors
- String(Optional): Finally, you can elect to add the log level in the third and final argument. (Default: 'error') (valid severity levels: "critical", "error", "warning", "info", "debug")
- Exception(Mandatory): exception to log to rollbar via the API.
- Object(Optional): each key-value pair will be reported in the same rollbar item. Useful for adding more context to your errors
- String(Optional): Finally, you can elect to add the log level in the third and final argument. (Default: 'error') (valid severity levels: "critical", "error", "warning", "info", "debug")
If you are using the browser-policy
package, you will need to add the Rollbar cloudfront distribution as a trusted script origin. You can do this with the current endpoint by adding the following to your code
BrowserPolicy.content.allowScriptOrigin('d37gvrvc0wt4s1.cloudfront.net');