UStAEnts / uems-hub

A hub project containing all microservices and frontend files for Union Event Management System (uems)
2 stars 0 forks source link

Logging #46

Open Lan2u opened 3 years ago

Lan2u commented 3 years ago

Is your feature request related to a problem? Please describe. We currently use console.log / .error on the backend, this system only works for local development, doesn't allow centralised logging of events across different parts of the system and doesn't have consistency in terms of the log structure (e.g. [DEBUG] etc. tags) making it hard to use with tools.

Describe the solution you'd like We need to setup a system to allow centralised logging, this will likely need a logging microservice + database which other microservices can send log messages to. We will also need a common logging library used throughout the backend to make this easier.

Describe alternatives you've considered We can continue with .log and .error for now as the gateway external API is currently blocking development on the front end.

We could use local logging but I think having designated logging microservices will result in the minimal amount of code reuse + allow ease of inspection.

Vitineth commented 3 years ago

Proposed idea: use winston (https://www.npmjs.com/package/winston) with a custom transport added (https://www.npmjs.com/package/winston#adding-custom-transports) to push to a logging microservice for global logging and analytics while still retaining local console / file logging for ease of development and debugging