Add logging functionality to already existing REST service.
- Add logger which will log incoming requests to service (at least
url
,query parameters
,body
) and responsestatus code
. - Add logger which will log all unhandled
errors
and return a standard message with HTTP code500
(Internal Server Error). - Add listener and logging to
uncaughtException
. - Add listener and logging to
unhandledRejection
. - Writing to
process.stdout
or to a file both can be used for logging. Any third-party logging library can also be used for this purpose. - Create multiple logging levels and store logging level in environment variable.