All versions of this manual
X
 

Audit trail

Audit trails are detailed logs about the operations performed on your graph databases by your users. Because they have the potential to take up a substantial amount of memory depending on the number of users and the operations performed, they are disabled by default.

Configuration

Audit trails can be enabled and configured in linkurious/data/config/production.json. They are found under the auditTrail key, which contains the following options:

  • enabled (default: false): Whether to enable audit trail recording.
  • logFolder (default: "audit-trail"): Where to store the results of the audit trail. This path is relative to the linkurious/data directory.
  • fileSizeLimit (default: 5242880, i.e. 5MB): Maximum size of one log file in bytes. A new file is created when the limit is reached (i.e. the logs are rotated). This avoids the creation of unworkably large log files.
  • strictMode (default: false): Whether to ensure that each operation has been logged before returning its result to the user. By setting it to true, logging will take place immediately; if false, the operation will be performed and will not be recorded in the audit trail until it is finished. This can have a substantial effect on the responsiveness of the server if, for example, large queries are run.
  • mode (default: "rw", read and write): Which kinds of user operation to log ("r" for READ, "w" for WRITE, "rw" for READ WRITE). Read operations are those that do not make changes to the database. Note that raw queries are considered READ WRITE and will appear in the audit trail whether or not they make changes do the database.
  • logResult (default: true): Whether to include the result of each operation in the log, i.e. whether to return a JSON representation of each node that has been added, updated, deleted, or simply matched. This can have a huge effect on log size: by setting logResult to false, the audit trail will only capture the properties of the nodes requested, the changes made to those nodes, or raw queries, and not the nodes themselves.
  • logPlugins (default: true): Whether to include all requests and JSON responses to plugins in the audit trail.
  • logFullTextSearch (default: false): Whether to include all requests and JSON responses from the search API in the audit trail.

Performances

Enabling the audit trail can impact performances negatively.

Here are options to consider to improve performances:

  • "mode": "w": only log write queries, ignore read queries
  • "logResult": false: only log the query sent by the user, not the response sent by the server
  • "strictMode": false: do not strictly wait for the audit-trail log to be written to response to each user request