Open Gnucki opened 7 years ago
Is this using the provided Bunyan mapper with forBunyan
? If so, you can provide your own mapping function:
var GelfStream = require('gelf-stream').GelfStream
var stream = new GelfStream(host, port, {map: myMappingFunction})
See how this is done in the source: https://github.com/mhart/gelf-stream/blob/master/gelf-stream.js#L117-L119
(or you could just get rid of any circular references before logging)
Yes, I use forBunyan
.
Of course, it is a solution if you do not want an evolution.
I do not see a way to get rid of that circular reference occuring in the response object of restify which is logged at trace level.
Thanks for your quick advice.
Hi!
When the 'flatten' function try to flatten a circular reference, it try to flatten until a stack overflow occurs. I see 3 solutions to solve that problem:
Tell me if you prefer a solution. I can make a PR if you want.