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

RangeError: Maximum call stack size exceeded with customize formatter #862

Closed
thinkkevin opened this issue Apr 28, 2016 · 8 comments · Fixed by #977
Closed

RangeError: Maximum call stack size exceeded with customize formatter #862

thinkkevin opened this issue Apr 28, 2016 · 8 comments · Fixed by #977

Comments

@thinkkevin
Copy link

thinkkevin commented Apr 28, 2016

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

@thinkkevin
Copy link
Author

thinkkevin commented May 4, 2016

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.

@skilledDeveloper
Copy link

skilledDeveloper commented Aug 29, 2016

I had similar issue and the change suggested by @thinkkevin fixed the issue. Can someone please merge the PR #868?

huncrys added a commit to huncrys/winston that referenced this issue Oct 11, 2016
@techbos
Copy link

techbos commented Dec 26, 2016

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.

@shahimclt
Copy link

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.

veger added a commit to veger/winston that referenced this issue Jan 13, 2017
@veger
Copy link
Contributor

veger commented Jan 13, 2017

Rebased PR/branch for version 2.3.0

@techbos
Copy link

techbos commented Jan 17, 2017

Would like to get a target release date for this fix please.

@avindra
Copy link

avindra commented Jan 20, 2017

This has been published, issue can be closed out

@jifeon
Copy link
Contributor

jifeon commented Jan 31, 2017

FYI guys, I still have decycling related issues. That's why #977 proposed

indexzero pushed a commit that referenced this issue Jul 27, 2017
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

Successfully merging a pull request may close this issue.

7 participants