diff --git a/index.js b/index.js index a6b3184b40db6cab26e83794c23c80b06d5cf79e..1368e7b6ca8941efdb88f179dc4820e644e05399 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)