winston-graylog2
winston-graylog2 copied to clipboard
TypeError when converting circular structure to JSON.
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)
Suggesting either a custom replacer that detects a circular reference and likely discards it or switch to util.inspect()
.