Bugzilla – Bug 6357
Changes in current Gram4 audit logging
Last modified: 2008-09-18 14:56:22
You need to
before you can comment on or make changes to this bug.
1. Make Derby the default DBMS for Gram4 auditing in configuration to
make trying out audit logging easier, as we then don't rely on an
2. Change configuration: Configure audit logging entirely in JNDI and
remove log4j configuration. The JDBCDatabaseAppender of Log4j is no
longer used and we don't need the log4j on-off switch for audit logging
anymore. This simplifies configuration.
3. Add fallback functionality: Currently a record is lost if it cannot be
stored in the database.
Store a record as a file in the filesystem if Gram4 cannot persist a
record into database. Periodically check for fallback records in the
filesystem and try to upload them into the database.
Remove the audit record fallback file if the upload into db worked fine.
4. Make use of JPA.
The Core team added openjpa libraries, so we can use it. It simplifies
our code and makes it easier to support different audit versions
5. Write tests for the code changes.
Done and committed to 4.2 branch and trunk.
About the fallback functionality:
The fallback records (in case a database operation fails) are written as
serialized objects to the filesystem.
The files are written to a directory configured in JNDI and are named
Files starting with "insert" are written if the initial insert of an
audit record into the database fails. Files starting with "update" are
written if there is already a record in the db and an update failed (later
in job processing)
An admin can configure a time interval after which an attempt is made to
upload all filesystem-persisted audit record files to the database.
First all insert_* files are tried, then the update_* files are tried (this
order is important because you cannot update something that does not exist ...)
For successfully uploaded records the file will be removed.
In case of a failure the record-file will keep on existing.
Todo: add documentation to online admin docs about configuration and behavior.