winstonjs / node-loggly

A client implementation for Loggly in node.js
http://github.com/winstonjs/node-loggly
Other
233 stars 80 forks source link

Stack overflow with cycles. #76

Open dankelleher opened 6 years ago

dankelleher commented 6 years ago

It looks like this issue has re-appeared. Minimal use case:

const loggly = require("loggly");

const client = loggly.createClient({
  token: <loggly-token>,
  subdomain: <subdomain>
});

const circular = { a : "123"};
circular.b = circular;

client.log(circular);

gives:

RangeError: Maximum call stack size exceeded
    at Object.common.serialize (/.../tmp-loggly-testcase/node_modules/loggly/lib/loggly/common.js:154:29)
    at Object.common.serialize (/.../tmp-loggly-testcase/node_modules/loggly/lib/loggly/common.js:187:21)
    at Object.common.serialize (/.../tmp-loggly-testcase/node_modules/loggly/lib/loggly/common.js:187:21)
dankelleher commented 6 years ago

PR here: https://github.com/winstonjs/node-loggly/pull/77