You can insert records into the audit log table via the standard LabKey Query APIs, such as LABKEY.Query.insertRows() in the JavaScript client API. For example, you can insert records in order to log backup events, client-side errors, etc.

Insert rows into the "Client API Actions" query in the "auditLog" schema. Logged-in users can insert into the audit log for any folder to which they have read access. Guests cannot insert in the audit table. Rows can only be inserted, they cannot be deleted or updated. A simple example using the JavaScript API:

schemaName: 'auditLog',
queryName: 'Client API Actions',
rows: [ {
comment: 'Test event insertion via client API',
int1: 5
} ]

For details on the API itself, see the documentation for LABKEY.Query.


Was this content helpful?

Log in or register an account to provide feedback

expand all collapse all