Connect sentry to logger

This commit is contained in:
Brandon Keepers 2017-04-08 12:18:31 -05:00
parent e64f65a5fc
commit fd3f1e0208
No known key found for this signature in database
GPG Key ID: F9533396D5FACBF6
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
const bunyan = require('bunyan');
const bunyanFormat = require('bunyan-format');
const sentryStream = require('bunyan-sentry-stream');
const cacheManager = require('cache-manager');
const createIntegration = require('github-integration');
const createWebhook = require('github-webhook-handler');
@ -33,11 +34,12 @@ module.exports = options => {
Raven.config(process.env.SENTRY_URL, {
captureUnhandledRejections: true
}).install({});
logger.addStream(sentryStream(Raven));
}
// Handle case when webhook creation fails
webhook.on('error', err => {
Raven.captureException(err);
robot.log.error(err);
});

View File

@ -17,6 +17,7 @@
"bottleneck": "^1.15.1",
"bunyan": "^1.8.5",
"bunyan-format": "^0.2.1",
"bunyan-sentry-stream": "^1.1.0",
"cache-manager": "^2.4.0",
"commander": "^2.9.0",
"dotenv": "~4.0.0",