Created
July 17, 2014 17:47
-
-
Save brianr/3111117facc14e08ceb8 to your computer and use it in GitHub Desktop.
node_rollbar log server-to-server requests and responses
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 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