Created
August 11, 2013 00:30
-
-
Save cggaurav/6202822 to your computer and use it in GitHub Desktop.
opbeat_config
This file contains hidden or 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
var opbeat = require('opbeat'); | |
var opbeat_options = { | |
organization_id: 'A', // Required unless OPBEAT_ORGANIZATION_ID environment variable is set | |
app_id: 'B', // Required unless OPBEAT_APP_ID environment variable is set | |
secret_token: 'C', // Required unless OPBEAT_SECRET_TOKEN environment variable is set | |
env: 'production' // Optional - falls back to NODE_ENV || 'development' | |
// hostname: '...', // Optional - falls back to OS hostname | |
// logger: '...', // Optional | |
// handleExceptions: false, // Optional - defaults to true | |
// silent: true, // Optional - defaults to false | |
// exceptionsAreCritical: false, // Optional - defaults to true | |
// stackTraceLimit: 10 // Optional - defaults to Infinity | |
}; | |
var client = opbeat.createClient([opbeat_options]); | |
client.on('logged', function (url) { | |
console.log('Yay, it worked! View online at: ' + url); | |
}); | |
client.on('error', function (err) { | |
console.log('oh well, Opbeat returned an error'); | |
}); | |
client.on('connectionError', function (err) { | |
console.log('Could not contact Opbeat :('); | |
}); | |
client.captureMessage('Boom'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment