From 658955ae62eca51b835daf3c0f98a321ab951153 Mon Sep 17 00:00:00 2001
From: Dominik Sigmund <dominik.sigmund@br.de>
Date: Tue, 28 Sep 2021 15:43:20 +0200
Subject: [PATCH] Added loglevel

---
 index.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index a6b3184..1368e7b 100755
--- a/index.js
+++ b/index.js
@@ -176,19 +176,20 @@ function Log (options) {
       }
     }
     if (this.options.loki && this.options.loki.active) {
-      let data = JSON.stringify({
+      let data = {
         streams: [
           {
             stream: {
               hostname: this.hostname,
-              app: this.name
+              app: this.name,
+              level: this.levels[tag]
             },
             values: [
               [Date.now().toString(), message]
             ]
           }
         ]
-      })
+      }
       this.request.post(this.options.loki.server + '/loki/api/v1/push', {body: data, json: true, strictSSL: false}, (error, res, body) => {
         if (error) {
           console.error(error)
-- 
GitLab