problem:
I want to develop a log management system that has the following features: 1- All logs collect from a queue and sequentially add to database 2- The data log can only be added and the system does not allow the user to edit it. 3- If the log data is changed through the database or a log data is deleted, the system must be able to recognize this change.
my solution: I'm serializing the log to Json. Then I calculate the hash(log+ the hash of the previous log) and store it for that log. To detect the change, I repeat this method and compare the calculated hash with the stored hash. If it was different, it indicates a change. But this method sometimes does not work properly. Without any change in the data, a different hash is calculated.
Do you have a better idea?