datalust / seq-logging

A Node.js client for the Seq HTTP ingestion API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Events with circular structures halts all logging to server

Cheesier opened this issue · comments

An event with properties that have circular structures makes _dequeBatch fail every time, stopping all logging.

Failing code: https://github.com/datalust/seq-logging/blob/dev/seq_logger.js#L212

I propose that in the case JSON.parse fails we try to build a new object but with a string indicating circular structures.

Example event:

const a = {};
a.a = a;
const event = {
  level: "Error",
  timestamp: new Date(),
  messageTemplate: 'Circular dependency issue!',
  properties: { a }
};`

Thanks for your work on this @Cheesier 🎉

Just going to look at the other PRs and issues and will have a new release version for you soon.