See below codes
var winston = require('winston');
var request = require('request');
var util = require('util');
var logger = new (winston.Logger)({
transports: [new winston.transports.Console({
level: 'info',
exitOnError: false,
json: false,
formatter: function defaultFormatter(options) {
console.log('formatter is called');
return options.message + '\n' + util.inspect( options.meta, {depth: 1});
}
})]
});
request.get('http://www.google.com', function(err, resp){
logger.info('Log response object.', resp);
});
When execute above code, RangeError occurs. And formatter is called is not printed in log
Similar to #100
The fix is add below code before https://github.com/winstonjs/winston/blob/master/lib/winston/common.js#L217
options.meta = meta;
Need to have options.meta decycled before clone.
I had similar issue and the change suggested by @thinkkevin fixed the issue. Can someone please merge the PR https://github.com/winstonjs/winston/pull/868?
When this can be released?
While waiting for the fix to be released, I simply log JSON.stringify(meta, null, 2), instead of logging meta directly.
Any Updates?
I have been constantly checking #862, #474 and #914 for an update. I also have a question posted here which too hasn't gotten any response.
Rebased PR/branch for version 2.3.0
Would like to get a target release date for this fix please.
This has been published, issue can be closed out
FYI guys, I still have decycling related issues. That's why #977 proposed
Most helpful comment
The fix is add below code before https://github.com/winstonjs/winston/blob/master/lib/winston/common.js#L217
Need to have
options.metadecycled beforeclone.