From 93e439c099f779bb8778bb766f01f7e0ac98613a Mon Sep 17 00:00:00 2001 From: Dominik Sigmund <dominik.sigmund@br.de> Date: Fri, 8 May 2020 11:36:13 +0200 Subject: [PATCH] switch to http for graylog --- README.md | 4 ++++ index.js | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 945bf0e..a22814a 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 4ca538e..688e02c 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() } -- GitLab