kutuluk / loglevel-plugin-remote

A loglevel plugin for sending browser logs to a server
MIT License
102 stars 36 forks source link

JSON formatting error: Please remove "logs": from remote.js #41

Open tim-mardesen opened 2 years ago

tim-mardesen commented 2 years ago

https://github.com/kutuluk/loglevel-plugin-remote/blob/ce3c8101d0a036476558ec7086f53358259466a3/src/remote.js#L272

There is an issue if I want to use the standardized JSON formatting that is supported by Loki:


  "streams": [
    {
      "stream": {
        "label": "value"
      },
      "values": [
          [ "<unix epoch in nanoseconds>", "<log line>" ],
          [ "<unix epoch in nanoseconds>", "<log line>" ]
      ]
    }
  ]
}```

Since there is a `"logs":` in your file, it will always have the parent level object of this JSON output be "logs" and not "streams".