title: Auditlogging functionality for zend db
body: <p>I have a requirement to implement audit logging functionality in a zend project. The models are created using zend db and the update function is as follows.</p>
  
  <pre><code>public function updateGroup($data,$id)
  {       
      $row = $this-&gt;find($id)-&gt;current();
      // set the row data
      $row-&gt;name                  = $data['name'];
      $row-&gt;description           = $data['description'];
  
      $row-&gt;updatedBy         = $data['updatedBy'];
      $row-&gt;updatedOn         = date('Y-m-d H:i:s'); 
  
      $id = $row-&gt;save();
      return $id;
  }
  </code></pre>
  
  <p>I have to create a table with the auditlog information which includes the current userid. I have tried many methods and nothing is a good solution. What is the best practice for a good audit logging functionality for zend?</p>
  
  <p>I just want to log only the modified data. and the log table schema is like </p>
  
  <pre><code>id, 
  table, 
  column,
  rowId
  oldvalue,
  newvalue,
  updatedon,
  updatedbyuser 
  </code></pre>