Deletes all audit events that occurred before the specified date and time from the SharePoint database.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
You may call object.Audit. only when object is an SPSite object.
The deletion of audit entries is itself an audited event. A call to creates an entry, and the method cannot delete the entry that it makes, so at least that one entry always exists in the database even if you attempt to delete all entries.
In Windows SharePoint Services 3.0, to delete all entries (except the entry described in the preceding paragraph) you cannot simply specify the current moment for deleteEndDate with Now. You must designate a future time. We recommend the following code, where mySiteCollection is a reference to an SPSite object.