15. Event Logging

Metacat keeps an internal log of events (such as insertions, updates, deletes, and reads) that can be accessed with the getlog action. Using the getlog action, event reports can be output from Metacat in XML format, and/or customized to include only certain events: events from a particular IP address, user, event type, or that occurred after a specified start date or before an end date.

The following URL is used to return the basic log- an XML-formatted log of all events since the log was initiated:


Note that you must be logged in to Metacat using the HTTP interface or you will get an error message. For more information about logging in, please see Logging In with the HTTP Interface.

<!-- Example of XML Log -->
<?xml version="1.0"?>
<dateLogged>2004-09-08 19:08:18.16</dateLogged></logEntry>
09-14 19:50:40.61</dateLogged></logEntry>

The basic log can be quite extensive. To subset the report, restrict the matching events using parameters. Query parameters can be combined to further restrict the report.

Parameter Description and Values
ipAddress Restrict the report to this IP Address (repeatable)
principal Restrict the report to this user (repeatable)
docid Restrict the report to this docid (repeatable)
event Restrict the report to this event type (repeatable) Values: insert, update, delete, read
start Restrict the report to events after this date Value: YYYY-MM-DD+hh:mm:ss
end Restrict the report to events before this date. Value: YYYY-MM-DD+hh:mm:ss

To view only the ‘read’ events, use a URL like:


To view only the events for a particular IP address, use a URL like:


To view only the events for a given user, use a URL like:


To view only the events for a particular document, use a URL like:


To view only the events after a given date, use a URL like:


To view only the events before a given date, use a URL like:


To view the ‘insert’ events for September 2004 (i.e., to combine parameters) use a URL like: