About database deletion and update logging issues

demand:

1.log;
2.log

requirements:

1.;
2.;
3.

which Daniel has ever achieved it? Solve.
the current idea is to use the mybatis interceptor to implement.

May.11,2022

has previously implemented a solution
is also an interceptor that uses MyBatis, but in order to avoid many useless log data
, a custom annotation is customized, annotated on the DO of the column that needs to be recorded, and the content is recorded in the interceptor.


you can also use the methods of aop, using the methods of update and delete as pointcuts, and then save the parameters and sql in the database.


mysql trigger, simple and rude, ok

for items with low concurrency
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ba21c3-2f5e4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ba21c3-2f5e4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?