Getting Started

Retrieving Audit Log

Updated: October 22, 2018 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

2 months ago Loubna Benzaama Fix Showcase Content add-on doc
2 years ago Solen Guitter 17
2 years ago Arnaud Kervern 16
2 years ago Solen Guitter 15
2 years ago Solen Guitter 14
2 years ago Arnaud Kervern 13
2 years ago Solen Guitter 11
2 years ago Solen Guitter 12
2 years ago Solen Guitter 10
2 years ago Solen Guitter 9
2 years ago Solen Guitter 8
2 years ago Solen Guitter 6
2 years ago Solen Guitter 7
2 years ago Bertrand Chauvin 5 | use contract created previously
2 years ago Bertrand Chauvin 3 | Replace portfolio with workspace to get more audit traces
2 years ago Bertrand Chauvin 4
2 years ago Bertrand Chauvin 2
2 years ago Bertrand Chauvin 1
History: Created by Bertrand Chauvin

We'd love to hear your thoughts!

All fields required