.. _UC16:

Use Case 16 - Log CRUD Operations
---------------------------------

.. index:: Use Case 16, UC16, Log CRUD, logging, reporting

Revisions
  View document revision history_.

Goal

  All create, read, update, and delete operations on metadata and data are
  logged at nodes (both Member and Coordinating) so that summary statistics
  may be derived for object access with grouping by node, object (identifier),
  and object owner.


Summary 

  Logging is important for monitoring performance and stability of the system
  as well as for ensuring appropriate attribution is given to contributors of
  content. This use case describes the action of logging a user request for
  content.

  This use case supports the reporting of log information as required by Use
  Case 17.

  The information recorded by log operations should be sufficient to enable
  grouping by node (node pid), object (pid), and by the object owner
  (principal pid) over time ranges. The type of access (create, read, update,
  or delete) should be recorded. The pid of the principal making the request
  should also be recorded.


Actors

  - User
  - Node (Member or Coordinating)


Preconditions 

  - User has authenticated, and is authorized for requested operation


Triggers

  - Any of the object access and modification operations are called.


Post Conditions

  - The operation is recorded in the log for the node.


.. 
   @startuml images/16_seq.png

   participant "Client" as app_client << Application >>
   participant "Read API\nStorage API\nReplication API" as m_crud << Node >>
   participant "Log Service" as m_log << Node >>
   app_client -> m_crud: operation (token, parameters)
   note right
     See Use Case 1, Use Case 4
   end note
   activate m_crud
   m_crud -> m_log: log (time, event, identifier, requestor)
   m_crud --> app_client: response
   deactivate m_crud
   @enduml

.. image:: images/16_seq.png

*Figure 1.* Interactions for use case 16.


.. _history: https://redmine.dataone.org/projects/d1/repository/changes/documents/Projects/cicore/architecture/api-documentation/source/design/UseCases/16_uc.txt