Member-only story
A Scheme for Simplifying Operation Log Recording
1、 Background
More and more backend system configurations require logging functions, and currently existing logging records cannot be reused. It is necessary to unify the logging format to improve the efficiency of logging development.
2、 Expected effect display
New Action:
Modification action:
Delete action:
3、 Data storage
Log construction focuses on two objects, one before modification and the other after modification:
- Before modification: null+After modification: X=new
- Before modification: Y+After modification: X=Update
- Before modification: Y+After modification: null=delete
The judgment of modifying content is based on the two objects passed in, comparing each attribute of the two objects one by one. If there is a change, a logging field is…