-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Uncaught exception when logging object with circular structure #978
Comments
Any update on this issue? |
I was able to get around this by specifying a "stringify" param in the options and using a library like circular-json:
|
Thanks @brrian, will try this |
For anyone else that comes here: this references 2.x branch not 3.x |
Development In regards to |
FYI circular JSON is supported by default in |
If the option "json" is set to "true" given arguments are converted to JSON.
If the argument has circular structures (as it can happen easily in express environments) the formatting command fails with an exception.
This happens for the console transport beginning with line 37
This also happens for the winston-daily-rotate-file transport
IMHO a logger should never fail while formatting the given object. Instead I would prefer if the argument in question would be omitted from logging.
What do you think?
I can provide patches if you agree.
The text was updated successfully, but these errors were encountered: