Open tomhaigh opened 8 years ago
We are running into this issue too
This is not a bug in winston-loggly. Could you please open this on winston
or comment on the appropriate issue there?
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??
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 https://github.com/winstonjs/winston/issues/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.