This repository has been archived by the owner on Jun 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
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
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) |
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
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
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" | ||
} | ||
} |