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

[Bug]: JSON format does not output error message #2470

Open
paul-uz opened this issue May 31, 2024 · 3 comments
Open

[Bug]: JSON format does not output error message #2470

paul-uz opened this issue May 31, 2024 · 3 comments

Comments

@paul-uz
Copy link

paul-uz commented May 31, 2024

🔎 Search Terms

error json format

The problem

The JSON format does not output the error message.

What version of Winston presents the issue?

latest

What version of Node are you using?

20.11.1

If this worked in a previous version of Winston, which was it?

No response

Minimum Working Example

No response

Additional information

No response

@gokulnath-prabakaran-zoomrx

Facing the same issue

@paul-uz
Copy link
Author

paul-uz commented Jun 5, 2024

I ended up combining the error and json formats. Not great though

@gokulnath-prabakaran-zoomrx

Hi @paul-uz , the above issue was resolved for me. Previously I was logging error object in error key. Now instead of error key rename it to err works
logger.error(msg, { error: ErrorObj });
Converting the above to below works
logger.error(msg, { err: ErrorObj });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants