Member-only story

A Scheme for Simplifying Operation Log Recording

1、 Background

Beck Moulton
5 min readJan 1, 2025

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…

--

--

Beck Moulton
Beck Moulton

Written by Beck Moulton

Focus on the back-end field, do actual combat technology sharing Buy me a Coffee if You Appreciate My Hard Work https://www.buymeacoffee.com/BeckMoulton

No responses yet