Tutorials

Retrieving Audit Log

Updated: February 9, 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

4 months ago Solen Guitter NXDOC-1087: Use new previous/next navigation
6 months ago GitHub Update review date
7 months ago Andrew Goodricke content-review-lts2016 label added
7 months ago Karin Touchie NXDOC-922: Correct English in Getting Started doc
8 months ago Solen Guitter Add missing navigation to previous/next steps in Getting Started with the Nuxeo Platform
8 months ago manonlumeau Moved Getting Started, update parents
9 months ago Solen Guitter 17
9 months ago Arnaud Kervern 16
9 months ago Solen Guitter 15
9 months ago Solen Guitter 14
10 months ago Arnaud Kervern 13
10 months ago Solen Guitter 11
10 months ago Solen Guitter 12
10 months ago Solen Guitter 10
10 months ago Solen Guitter 9
10 months ago Solen Guitter 8
10 months ago Solen Guitter 6
10 months ago Solen Guitter 7
10 months 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