How to disable audit logs in a list or query

LabKey Support Forum (Inactive)
How to disable audit logs in a list or query eva pujadas  2017-04-21 02:43
Status: Closed
 
We are trying to disable audit logging in several lists. We have tried by adding XML metadata to the list's metadata through the menu Admin --> Developer Links--> Schema Browser--> select list --> edit metadata --> Edit source --> XML metadata

We added the following in the XML metadata text box:

<tables xmlns="http://labkey.org/data/xml">
  <table tableName="Test" tableDbType="TABLE">
    <auditLogging>NONE</auditLogging>
    <columns>
      <column columnName="Sum of ru_wallclock">
        <conditionalFormats>
          <conditionalFormat>
            <filters>
              <filter operator="gt" value="0" />
            </filters>
            <backgroundColor>FF00FF</backgroundColor>
          </conditionalFormat>
        </conditionalFormats>
      </column>
    </columns>
  </table>
</tables>

The conditional format was added as a test and is working as expected. Nevertheless, the audit logging set to "NONE" is not working, and the system continues by recording the audit details.
What are we doing wrong?

Thanks for your great support,
Eva Pujadas
 
 
Jon (LabKey DevOps) responded:  2017-04-25 11:28
Hi Eva,

I'll need to get this confirmed, but based on my own testing, I do not believe this will work on any lists or queries you build within LabKey itself and the auditing is only for tables and queries that are created via module.

Thank you for your patience.

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2017-04-27 18:28
Hi Eva,

I was able to get confirmation that this is actually working as designed.

The <auditLogging> tag doesn't prevent things being picked up in the list and dataset audit logs, but instead works at not logging any events in the Query Update Events and it only works with the TableInfo, so lists and datasets will always get picked up in this case.

Regards,

Jon
 
eva pujadas responded:  2017-04-28 08:05
Hi Jon,

Thanks a lot for your feedback.

At this point, I would have two questions:
1) Is there some way to disable audit logs for certain lists?
2) Is there some way to delete audit log records of certain lists?

As a background, we have some Python scripts which, through the LabKey Python API, perform regular inserts and updates in several lists, using "labkey.query.update_rows" and "labkey.query.insert_rows".
Currently the audit log table for "List events" has more than 3 millions rows, and that makes the system slow when viewing the history of changes. Additionally, we do not need to have an audit trail for the records modifications or record insertions.

Thanks once more for your support,
Eva
 
Jon (LabKey DevOps) responded:  2017-04-28 11:09
Hi Eva,

Unfortunately we do not have a way to delete or disable the audit logs through the UI out of the box.

The only way to conceivably do this is to either update the core code that controls auditing to allow for this or to delete rows within the database that are tied to the auditing. However, both things are unsupported, so we wouldn't be able to assist you if anything went wrong here.

Regards,

Jon
 
eva pujadas responded:  2017-08-03 23:45
Hi Jon,

Thanks for your answer and for your great support.

We have been checking the second solution's possibility you mention: deleting rows in the database.

As a first try in a test server, we have deleted in the list audit table (audit.c3d11_listauditdomain) all the records from a particular target folder and list, and observed no issues.

Could you confirm that such a deletion in the database is save? That's the proposed deletion:

delete from audit.c3d11_listauditdomain where container like 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' and listname like 'DummyListName';

Best regards,
Eva
 
Jon (LabKey DevOps) responded:  2017-08-04 09:46
Hi Eva,

Deleting tables, especially core tables like the one mentioned, is not supported as stated earlier. We cannot guarantee that there won't be any side-effects here since the system will continue to attempt to write to a table that doesn't exist, even if you are not observing any issues currently. Unfortunately, we are not able to provide support for this action since this is using the platform outside of its original design.

If you are interested in establishing a contract/work order with us to explore and develop a way to enhance the platform further to allow you to restrict visibility in the logging/auditing of lists, please let us know and we will be happy to have someone reach out to you to explore this option.

Regards,

Jon
 
eva pujadas responded:  2017-08-10 03:15
Hi Jon,

Thanks a lot for your answer.

Just for clarification, we are not thinking about dropping audit tables, only records in one of the audit tables related to a particular list in a particular project's folder.

I understand you are not supporting those kind actions in the system. Anyway, my question was only just to know if you had already some experience with it, which allows you to give some recommendations.

Best regards,
Eva
 
jeckels responded:  2017-08-10 09:23
Hi Eva,

While we don't support or recommend this type of direct database manipulation, I think it should work for your intended purpose here.

Thanks,
Josh
 
eva pujadas responded:  2017-08-18 10:15
Hi Josh,

Thanks for your support.

Finally we could solve this issue by creating an index on the table "audit.xxxxx_listauditdomain", column "listitementityid".
In our system, this table currently contains more than 4.5 millions of records. By creating the index, we could speed very much showing the item history of a record in a list. Before the index creation, showing the item history would take about 2 minutes, after that it takes only about 2 seconds.

I just wanted to share the experience in case it can be useful to somebody else.

Regards,
Eva
 
jeckels responded:  2017-08-18 10:51
Hi Eva,

Thanks for the followup. I'll make a change so that column is indexed by default in 17.3.

Thanks,
Josh