maratonusp / contestwatcher

A telegram bot for checking upcoming contests
MIT License
55 stars 16 forks source link

Log exceptions to file #28

Open LGBitencourt opened 6 years ago

LGBitencourt commented 6 years ago

For some reason, winston is not logging the exceptions.

victorsenam commented 6 years ago

Did b3610f1 solve this?

LGBitencourt commented 6 years ago

No

gabrielrussoc commented 6 years ago

somehow it seems to be working now...

the only thing I did was to delete the old log file and let the app create it, but I'm not sure if this is the real reason

victorsenam commented 6 years ago

Not working. Apparently winston only tracks exceptions on files where it has been required. This thread suggests that we should add logger in every file. It is enough to require winston since we are using the default Logger instance of winston.

victorsenam commented 6 years ago

Still not working. The bot shut down unexpectedly during a fetch (non-scheduled, therefore, requested) and did not print a trace. logger is included in every file related to this process: app.js,fetch.js,every file inside fetchers and msg_handlers/contest_list.js. Did I miss something? Maybe it is required to include winston instead of logger.js. I can't understand why, though.