Opened 19 years ago
Closed 15 years ago
#108 closed enhancement (fixed)
Logging the change history of an item
Reported by: | Nicklas Nordborg | Owned by: | Nicklas Nordborg |
---|---|---|---|
Priority: | minor | Milestone: | BASE 2.13 |
Component: | core | Version: | |
Keywords: | Cc: |
Description
Implement a log function that logs whenever an item is modified. It should be able to store time and logged in user. If possible, it could also store the old and new values of the changed properties. It should be possible for a server admin to configure if this function should be enabled and how much info that should be logged. If possible, the function could be pluggable to allow logging into other places than the database.
Change History (34)
comment:1 by , 19 years ago
Milestone: | → BASE 2.0 |
---|
comment:2 by , 18 years ago
Milestone: | BASE 2.0 → BASE 2.0+ |
---|
comment:3 by , 18 years ago
Milestone: | BASE 2.x+ → BASE 2.2 |
---|
comment:4 by , 18 years ago
Milestone: | BASE 2.2 → BASE 2.x+ |
---|
comment:5 by , 16 years ago
comment:7 by , 15 years ago
Milestone: | BASE 2.x+ → BASE 2.13 |
---|
comment:8 by , 15 years ago
(In [5038]) References #108: Logging the change history of an item
This enables configurable logging possibility. An implementation that logs to the database is supplied but turned off by default. All annotatable items has got support for logging, but only changes that happens on the item itself is logged. Eg. changes to annotations, files, etc. are not yet possible to log.
A single log entry corresponds to one database transaction and contains information about:
- Date and time
- The user that made the change
- The session that the change was made in
- Which client application that was used
- Which project that was active
- Which plug-in/job that was executing when the change was made
- All items that was created/modified/deleted in the transaction
comment:9 by , 15 years ago
comment:10 by , 15 years ago
comment:11 by , 15 years ago
comment:12 by , 15 years ago
comment:13 by , 15 years ago
comment:14 by , 15 years ago
comment:15 by , 15 years ago
(In [5054]) References #108: Logging the change history of an item
- Added special logger implementation for annotations. At the moment it can only catch CREATE and DELETE changes, since updating annotation only results in a change in the ParameterValues table. I'll figure out a way to fix it.
comment:16 by , 15 years ago
comment:17 by , 15 years ago
(In [5057]) References #108: Logging the change history of an item
- Use WeakReference in LogControl.DbControl to make sure the DbControl is garbage collected correctly (test in TestDbControl failed)
comment:18 by , 15 years ago
(In [5058]) References #108: Logging the change history of an item
- We must tell DbControll.reattach() if the item has been updated while it was detached or not or the logging will not work as expected. NOTE!!! This is a backwards compatibility problem that needs to be documented!!!
comment:19 by , 15 years ago
(In [5059]) References #108: Logging the change history of an item
- Fixes a NullPointerException that prevent annotated items from being deleted.
comment:20 by , 15 years ago
comment:21 by , 15 years ago
comment:22 by , 15 years ago
comment:23 by , 15 years ago
(In [5063]) References #108: Logging the change history of an item
- Added special loggers for data files (FileSetMember) and plate events
comment:24 by , 15 years ago
comment:25 by , 15 years ago
comment:26 by , 15 years ago
comment:27 by , 15 years ago
comment:28 by , 15 years ago
comment:29 by , 15 years ago
comment:30 by , 15 years ago
comment:31 by , 15 years ago
comment:32 by , 15 years ago
comment:33 by , 15 years ago
comment:34 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
There is a discussion about some problems related to this in ticket #966. I got a new idea that maybe can work out. It builds on the Hibernate hook that we can use to detect create/update events to items at a fine-grained level. Instead of trying to associate the event with the correct parent item at the time of the update we could just store the informatation that we have. Then, when someone is interested of seeing the change history of an item we can also find out which items are related and include the change history of those items. For example: if a user is interested in the change history of a sample, we will also load and merge the change histories of all annotations attached to the sample. This will be a lot easier than going backwards from the annotation to the sample at the time of the update.
In order to know which changes that are related everything in a single transaction should have the same 'transactionId'. The changes can also be linked to a Session, which allows us to know if the changes was made through a plug-in or directly in the web interface.
The log table should not have any "hard" foreign keys to other tables since that would block deletion of items. Instead we should consider implementing a cleaning functionality that at regular intervals removes the change history for items that no longer exists.
Not all items should be logged. We can use a tagging interface (eg. LoggableData) that are added to classes that we want to log. It is a bad idea to log items that are batchable (eg. reporters). It would kill performance on the server.