Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when converting circular structure to JSON. #80

Open
jeremy-j-ackso opened this issue Feb 24, 2020 · 1 comment
Open

TypeError when converting circular structure to JSON. #80

jeremy-j-ackso opened this issue Feb 24, 2020 · 1 comment

Comments

@jeremy-j-ackso
Copy link
Contributor

There should be a strategy for dealing with circular JSON structures so that we can get some kind of logging on them.

TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'TLSSocket'
    |     property 'parser' -> object with constructor 'HTTPParser'
    --- property 'socket' closes the circle
    at JSON.stringify (<anonymous>)
    at graylog.log [as _log] (/app/node_modules/graylog2/graylog.js:170:31)
    at graylog.info (/app/node_modules/graylog2/graylog.js:106:17)
    at Immediate.<anonymous> (/app/node_modules/winston-graylog2/lib/winston-graylog2.js:79:50)
    at processImmediate (internal/timers.js:456:21)
@jeremy-j-ackso
Copy link
Contributor Author

jeremy-j-ackso commented Feb 24, 2020

Suggesting either a custom replacer that detects a circular reference and likely discards it or switch to util.inspect().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant