- I'd like to make note of sensitive changes in my app.
- I'd like to be able to query these changes from day one.
- I'd like to leave architecting a long term solution for later.
- I'd like these records to persist.
- I'd like to create alarms around some changes that get sent to a business (not development) team.
- Add a sub-logger to python's logging module.
- Add a rule in my infrastructure that recognizes the sub-logger logs and directs them to a log group with different persistence rules.
- Format the sub-logger logs to be JSON for easier querying and processing.
By making this a part of the logging infrastructure, the sub-logger is always handy and easily retrievable. AWS CloudWatch has support for queries, so we have a strong search ability out of the box. In theory, an update to the sub-logger could have the records be directed to a more appropriate storage option, such as DynamoDB.