-
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
[Bug]: Winston Error not output anything. #2133
Comments
I have something similar happening. I give an instance of Error into the logger:
But inside errors.js of the logform library einfo is not an instance of Error:
I am not sure at what point the inserted Object becomes not an Error instance. My transports settings:
|
I have found, what my mistake was. You have to add
|
@CAGLADJ for me it only shows the stack when prettyPrint is on, did you had the same issue? |
Please verify this with a version v3.7.2 introduced a major regression with support for logging errors. See here for additional information. This version release was subsequently reverted and we re-released a previous version to minimize impact. As such none of what 3.7.2 introduced is live on a newer version. As such I'll be closing this issue as a duplicate (regressions in v3.7.2 are being tracked by #2029). If you are successfully able to reproduce this issue with a later version, please do not hesitate to re-open this! 🙇🏻 |
🔎 Search Terms
logger.error not working
The problem
I have a logger in my code like
I tried
if (info instanceof Error)
but that always came back false in my Error Stack Format function.however when I get a logger.error(error) from anywhere else in the application
`if (info.level === 'error')
the console.dir in here doesn't seem to include ANYTHING, and what I get on the screen is
when what I really want out in both the error file and the screen is information on the error and where to find it.
I have been through documentation and stack overflows and they told me to use the
winston.format.errors({ stack: true }),
, which I am already using.two things"
1.) Don't know why a caught errror or a callback error isn't seen as an instance of an Error when it gets to the logger function I made.
2.) I can't use winston in any way if it won't give me the error info and how to fix it if one occurs.
What version of Winston presents the issue?
3.7.2
What version of Node are you using?
16.14.2
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: