me-ventures / microservice-toolkit

MIT License
3 stars 1 forks source link

Install optional handlers for 'uncaughtException' and 'unhandledRejection' #7

Closed MaikelH closed 7 years ago

MaikelH commented 7 years ago

uncaughtException and unhandledRejection are two events that would be useful to have some metrics on. For example send some metrics that there was a exception.

To make it optional there can be a option in the logger config to enable or disable the eventhandlers.

EvaLok commented 7 years ago

this sounds good; i suppose we could give some pre-set handlers enabled via config that can then be overwritten at the user's discretion?

MaikelH commented 7 years ago

Yeah exactly, you can disable in them config and the user can use it is own handlers. Since it is an event, it is also possible to have multiple handlers.