Skip to content
This repository has been archived by the owner on Jun 8, 2018. It is now read-only.

Commit

Permalink
Beta changes
Browse files Browse the repository at this point in the history
  • Loading branch information
listepo committed Apr 17, 2015
1 parent 2b5ef81 commit efca96a
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 8 deletions.
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# Sails hook for Sentry(raven-node)
# sails-hook-sentry

[Sails JS](http://sailsjs.org) hook to log errors and stack traces in [Sentry](https://github.com/getsentry/sentry) from within your Sails.js applications.

### Installation

`npm install sails-hook-sentry`

### Usage
*requires at least sails >= 0.11*

### Configuration

By default, configuration lives in `sails.config.sentry`. The configuration key (`sentry`) can be changed by setting `sails.config.hooks['sails-hook-sentry'].configKey`.

#### Example

```javascript
// [your-sails-app]/config/sentry.js
module.exports.sentry = {
active: true,
dsn: "{{ DSN }}",
level: 'error'
};
```

```javascript
// [your-sails-app]/api/controllers/UserController.js
/**
* UserController
*
* @description :: Server-side logic for managing users
* @help :: See http://links.sailsjs.org/docs/controllers
*/

module.exports = {
find: function(req, res) {
sails.sentry.captureMessage("Another message");
res.ok('ok');
}
};
```
More *sails.sentry* methods [raven-node](https://github.com/getsentry/raven-node)
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ module.exports = function(sails) {
return cb();
}

if (!sails.config[this.configKey].dsn) {
sails.log.verbose("DSN for Sentry is required.");
return cb();
}

var client = new raven.Client(
sails.config[this.configKey].dsn,
{
Expand Down
27 changes: 20 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
{
"name": "sails-hook-sentry",
"version": "1.0.0",
"version": "1.0.0-beta.1",
"description": "Sails hook for Sentry(raven-node)",
"main": "index.js",
"keywords": [
"raven",
"sentry",
"node",
"errors",
"debugging",
"exceptions",
"sails",
"hook"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/listepo/sails-hook-raven-node.git"
"url": "https://github.com/listepo/sails-hook-sentry.git"
},
"author": "",
"author": "Ivan Tugay <[email protected]>",
"license": "ISC",
"bugs": {
"url": "https://github.com/listepo/sails-hook-raven-node/issues"
"url": "https://github.com/listepo/sails-hook-sentry/issues"
},
"homepage": "https://github.com/listepo/sails-hook-raven-node",
"homepage": "https://github.com/listepo/sails-hook-sentry",
"sails": {
"isHook": true
},
"devDependencies": {
"sails": "^0.11.0"
"engines": {
"node": ">= 0.12"
},
"dependencies": {
"raven": "^0.7.3"
},
"devDependencies": {
"sails": "^0.11.0"
}
}

0 comments on commit efca96a

Please sign in to comment.