Created
February 21, 2014 02:12
-
-
Save thinkjson/9127517 to your computer and use it in GitHub Desktop.
Loggly example
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 http = require('http'); | |
| var options = { | |
| host: 'logs.loggly.com', | |
| port: 80, | |
| path: '/inputs/{input_id}', | |
| method: 'POST' | |
| }; | |
| exports.write = function(data) { | |
| var req = http.request(options, function(res) {}); | |
| req.on('error', function(e) { | |
| console.log('Could not log request: ' + e.message); | |
| }); | |
| req.write(data); | |
| req.end(); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment