guzru / winston-sentry

Sentry transport for winston logger for node js
MIT License
82 stars 37 forks source link

Support for stack traces #3

Closed Almad closed 10 years ago

Almad commented 12 years ago

Currently, there is no way to provide error objects in a way that will preserve stack traces in sentry.

For pinpointing production errors, that would be great (and is supported by raven-node).

zzen commented 12 years ago

A quick clarification on behalf of @Almad - we're using winston to log errors like:

log.error('Hi, I am a bad error', new Error())

However, winston-sentry sees that the log level is error and automatically creates a new Error() object and logs that. The log function could be just a little more clever and check if the incoming parameters are instanceof Error. In my mind, there are 3 valid signatures:

guzru commented 12 years ago

I'll look into this when I can (cannot say when though), but I thank @zzen for the explanation and the suggestion. Anyway, AFAIK winston is currently unmantained, so it might be a good idea not to rely on this at least for new projects. I currently do not have time to check out what the situation is.

shaharke commented 10 years ago

This issue is was resolved in #9, but I still need to publish a newer version to NPM (waiting for @guzru). I suggest to test your code on the master branch and let me know if it works for you. All the use cases you mentioned above are supported as follows:

shaharke commented 10 years ago

Version 0.0.6 now supports stack traces as described above