garageScript / c0d3r

Bot for c0d3.com's Discord channel.
0 stars 4 forks source link

Add logging #12

Open JasirZaeem opened 3 years ago

JasirZaeem commented 3 years ago

Need logging in the bot to record errors for better awareness of bugs and help in investigating them.

Current state

Errors are sent as response to the caller of the api. #11 adds logging using console.error in the errorHandler middleware which should make the errors visible on the caprover dashboard where c0d3ris deployed.

Proposed Solution

Add winston to log errors and use winston-logflare transport to forward them to our logflare account.

flacial commented 1 year ago

Or Sentry

JasirZaeem commented 1 year ago

Sentry != Logging. Sentry is a more specialized service, aimed at tracking things that are rarer/exceptional and need immediate action like app crashes, performance regressions etc. and including extra information with them that is necessary like stack traces. Logging is more general event tracking, you'd use sentry in addition to logging. Where events that are relevant to things sentry is for get sent to sentry in addition to logs.

User tries to login with incorrect credentials -> logs User makes a post that crashes the app -> logs + sentry

Tracking every time a new feature is used -> logs, then you can analyze the logs maybe after a month to measure adoption. New feature crashing the mobile app -> logs + sentry

flacial commented 1 year ago

@JasirZaeem Thanks for explaining the difference between the two!