diff --git a/README.md b/README.md index 945bf0e219bb35ed249fb68ac88d6958f18ca2c0..a22814a534193e264f742c1a94724ab81b7c904b 100644 --- a/README.md +++ b/README.md @@ -39,3 +39,7 @@ Note: The options Part may be omitted, as all parts are optional, but using the loglevel: 'Minimal LogLevel. Default: WARN' } ``` + +## Graylog + +To use graylog, your graylog-server needs to have an http-input setup. diff --git a/index.js b/index.js index 4ca538e0d345cb733f33268128a0c6bf64dd5452..688e02ca7cd240ac9e7d0e9a671aab2538aff4d1 100644 --- a/index.js +++ b/index.js @@ -25,7 +25,7 @@ function Log (options) { this.hostname = os.hostname() } if (this.options.graylog && this.options.graylog.active) { - this.https = require('https') + this.http = require('http') } if (this.options.file) { this.fs = require('fs') @@ -136,7 +136,9 @@ function Log (options) { 'Content-Length': data.length } } - var post = this.https.request(options) + var post = this.http.request(options) + + // post the data post.write(data) post.end() }