title: How do you implement audit trail for your objects (Programming)?
body: <p>I need to implement an audit trail for Add/Edit/Delete on my objects,I'm using an ORM (XPO) for defining my objects etc. I implemented an audit trail object that is triggered on </p>
  
  <ol>
  <li>OnSaving </li>
  <li>OnDeleting</li>
  </ol>
  
  <p>Of the base object, and I store the changes in Audit-AuditTrail (Mast-Det) table, for field changes. etc. using some method services called.</p>
  
  <p>How do you implement audit trail in you OOP code? Please share your insights? Any patterns etc? Best practices etc? Another thing is that how to disable audit when running unit test,since I don't need to audit them but since base object has the code.</p>
  
  <p>Changes to object (edit/add/del) and what field changes need to be audited</p>