title: Hibernate audit log of fields' change
body: <p>How can I log the changes of the entity into log files? 
  Consider I have <code>Person</code> like this.</p>
  
  <pre><code>import org.hibernate.envers.Audited;
  import javax.persistence.Entity;
  import javax.persistence.Id;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Column;
  
  @Entity
  @Audited
  public class Person {
      @Id
      @GeneratedValue
      private int id;
  
      private String name;
      private String surname;
  // add getters, setters, constructors, equals and hashCode here
  }
  </code></pre>
  
  <p>and a code of changing existing <code>Person</code></p>
  
  <pre><code>Person p1 = new Person("name-1", "surname-1");
  personRepository.save(p1);
  Person p2 = personRepository.findOne(1L);
  p2.setName("new-name");
  personRepository.save(p2);
  </code></pre>
  
  <p>How can I have </p>
  
  <ul>
  <li>old entity</li>
  <li>new entity</li>
  <li>list of fields changed (some thing like <a href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/builder/Diffable.html" rel="nofollow noreferrer">Diffable</a>'s result)</li>
  </ul>
  
  <p>In my log file? I know that <a href="https://docs.jboss.org/envers/docs/" rel="nofollow noreferrer">envars</a> can store changes in db and let me extract them later with <code>AuditReader</code> but I like to store changes in Json file to send them to third party applications (like Elastic).</p>