Purging the audit log

Background

OSCAR 15 will create ALOT of log data compared to OSCAR 12. Due to this, a new feature was added in build #722. Audit log data is written to the 'log' table.

OSCAREMR-6302 - Getting issue details... STATUS


There are 2 modes

  1. Automatically using a scheduler.
  2. Manually using the Administration interface.


Note on limitations: This feature will not currently work with a remote database. 

Manually purging the Audit Log

There's some configuration required to use this feature

  1. In the properties file, you should be sure about your log.purge.minDays propertyWhat this value tells the system, is to not allow the purging of any data which is more recent than the threshold set here. So if you set log.purge.minDays=365, the feature will never purge data within the last year.
  2. You must give the security object "_admin.auditLogPurge" to users who will be authorized to manually run this function from the administration panel.
  3. Set log.purge.mysqldump to the location of your mysqldump  executable
  4. Set log.purge.outputdir to determine where the data to be purged will be written to (a mysqldump file). If not set, DOCUMENT_DIR will be used.

You should be able to go to the Administration Panel, and under Data Management to access the wizard.



Automatically purging the Audit Log

Make sure you've setup the properties above accordingly. In addition, you will need to set log.purge.daysfromnowtopurge. This value determines how far into the past to purge the audit log records. If you set 365 here, then every time this job runs, it will purge all audit log records older than 365 days.

Setup the job in the Oscar Job interface of the Administrative Panel.


The Job Type class is org.oscarehr.admin.job.AuditLogPurgeJob