-
Notifications
You must be signed in to change notification settings - Fork 111
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
Error instances are recorded as an empty object #37
Comments
We are running into this issue too |
This is not a bug in winston-loggly. Could you please open this on |
Please can you explain why this isn't a bug in winston-loggly? From what I can tell, some of the problematic behaviour is due to winston-loggly using the cloned meta parameter as the base message object that is eventually passed to node-loggly. If this meta parameter is an instance of Error, then the message property is a getter, but winston-loggly attempts to overwrite this with the actual log message string, which doesn't work, and so you get the empty log message problem. |
Misread your original post. Reopening. |
any advance on this issue?? |
Update package.json dependencies
When logging a meta value which contains an error, none of the properties are written, and the log message is lost.
e.g.
winston.error("error", new Error("test"))
output in loggly:
{"level":"error"}
message
property as a getter which (per the above) isn't written to JSON.This doesn't seem related to winstonjs/winston#280 which I initially thought was the cause - updating to the latest version of Winston does not solve it.
I think a fix requires more than just fixing the JSON-encoding of Error objects - that would still result in conflict between the two
message
properties when logging Errors (the error message and the log message). It could be nicer if themeta
parameter was written to the loggly message as ameta
property within the JSON, but this would be a change to existing behaviour.The text was updated successfully, but these errors were encountered: