Tutorials

Retrieving Audit Log

Updated: July 26, 2017 Page Information Edit on GitHub

Goal

Retrieve a document's audit log to gather its history. All actions made on a document are stored in this audit log for security review purpose.

Prerequisites

Procedure

  1. Create a file called getDocumentAudit.js with the following content.

    #!/usr/bin/env node
    const Nuxeo = require('nuxeo');
    const nuxeo = new Nuxeo({
        auth: {
            method: 'basic',
            username: 'Administrator',
            password: 'Administrator'
        }
    });
    let docToFetch = '/default-domain/workspaces/North America/awesome-tech/skynet-ai-maintenance';
    nuxeo.repository()
        .fetch(docToFetch)
        .then(doc => {
            return doc.fetchAudit();
        })
        .then(audit => {
            console.log(`Document's audit log is as follows:`);
            console.log(audit);
        })
        .catch(error => {
            console.log(`Apologies, an error occurred while retrieving the document's audit log.`);
            console.log(error);
        });
    
  2. Save and run:

    $ node getDocumentAudit.js
    

Learn more

22 days ago manonlumeau NXDOC-1276
10 months ago Solen Guitter 17
a year ago Arnaud Kervern 16
a year ago Solen Guitter 15
a year ago Solen Guitter 14
a year ago Arnaud Kervern 13
a year ago Solen Guitter 11
a year ago Solen Guitter 12
a year ago Solen Guitter 10
a year ago Solen Guitter 9
a year ago Solen Guitter 8
a year ago Solen Guitter 6
a year ago Solen Guitter 7
a year ago Bertrand Chauvin 5 | use contract created previously
a year ago Bertrand Chauvin 3 | Replace portfolio with workspace to get more audit traces
a year ago Bertrand Chauvin 4
a year ago Bertrand Chauvin 2
a year ago Bertrand Chauvin 1
History: Created by Bertrand Chauvin