title: Modify audit trail in Alfresco using a custom webscript
body: <p>I am writing a custom Java webscript that accepts document noderef and an external username (string value) as parameters. I have auditing enabled and the audit log shows access to the document when I call the webscript. Now I wanted to know if it is possible to modify the audit trail so that when it shows the log for that particular document it also shows the name of the external user.</p>
  
  <p>webscript url: <a href="http://localhost:8080/alfresco/service/node/%7Bnoderef%7D/user/%7Buser%7D" rel="nofollow noreferrer">http://localhost:8080/alfresco/service/node/{noderef}/user/{user}</a></p>
  
  <p>On calling this I get the following output in log:</p>
  
  <pre><code>Extracted audit data: 
      Application:    AuditApplication[ name=alfresco-access, id=1, disabledPathsId=2]
      Values:         
          /alfresco-access/transaction/sub-actions=readContent
          /alfresco-access/transaction/action=READ
          /alfresco-access/transaction/node=workspace://SpacesStore/c21db432-4ad6-4af2-8bcf-78bc89724afe
          /alfresco-access/transaction/type=cm:content
          /alfresco-access/transaction/path=/app:company_home/app:shared/cm:audit-services-context.xml
          /alfresco-access/transaction/user=admin
  
      New Data: 
          /alfresco-access/transaction/sub-actions=readContent
          /alfresco-access/transaction/action=READ
          /alfresco-access/transaction/type=cm:content
          /alfresco-access/transaction/user=admin
          /alfresco-access/transaction/path=/app:company_home/app:shared/cm:audit-services-context.xml
  </code></pre>
  
  <p>I want to store the {user} also in the audit trail.</p>