Consider that you want to create audit logs during the creation or edit of database records. One easy way is to Serialize both versions (Old and New) of the same record and detect the differences between them.
Check for the Demo application. It shows a way to achive this using JSON Diff.