I've done this in the past and found basically 2 approaches: Model-based and Controller-based.
Model-based within the model itself override the
save
andupdate
methods (assuming an ActiveRecord pattern) to create a new entry in theChangeLog
table.Controller-based add the
ChangeLog
record creation logic to each controller that you want to track.
I prefer the Controller-based approach since you have more control over what's going on and when. Also, you have full access to the user session so it's easier to add tracking for auditing purposes.