Skip to content

Instantly share code, notes, and snippets.

@brianr
Created July 17, 2014 17:47
Show Gist options
  • Select an option

  • Save brianr/3111117facc14e08ceb8 to your computer and use it in GitHub Desktop.

Select an option

Save brianr/3111117facc14e08ceb8 to your computer and use it in GitHub Desktop.
node_rollbar log server-to-server requests and responses
var rollbar = require('rollbar');
rollbar.init("access token here");
function makeRequest(url, args) {
// third param is a callback fired upon completion
doMakeRequest(url, args, function(response) {
// log the request and response to rollbar
rollbar.reportMessageWithPayloadData("Made request to " + url,
{level: 'info', custom: {request_args: args, response: response}});
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment