rodekruis / IBF-system

Tools required to trigger, manage and execute the Red Cross Early Action Protocols for natural disasters.
https://ibf.510.global
Apache License 2.0
12 stars 15 forks source link

[TASK] API-service should write logs to a file on production #1578

Open gulfaraz opened 4 days ago

gulfaraz commented 4 days ago

Who is your contact person for this task?

@gulfaraz

User Story

As a devops I want to access production logs So that I can investigate errors, db access, and other activity

### **What needs to be done**
- [ ] DB logs - Update [ORM](https://github.com/rodekruis/IBF-system/blob/bdcd9c81415dc1774273219334c579a0b5bf7959/services/API-service/ormconfig.ts#L17) config to write to file instead of console
- [ ] NestJS logs - Add logger which writes to a file
- [ ] Investigate if any other loggers need to exist for observability of the app
- [ ] Create follow-up issue: make file accessible outside VM
### **Acceptance Criteria**
- [ ] Update code to implement logging
- [ ] Create a follow-up issue to add sufficient logs for the generated logs to become useful

Additional context

The lack of logs became a problem for this bug. We resorted to using the mailchimp campaign history instead but it was insufficient to identify the actual decision made by the app.

jannisvisser commented 1 day ago

@gulfaraz tag @BlaiseSelvan for new issues. FYI @diderikvw .

diderikvw commented 18 hours ago

Refinement: Jannis checks if there is something somewhere already.