Audit Logs
In audit logs page, we can see all user interactions with the application:
![Audit logs](https://raw.githubusercontent.com/aspnetzero/documents/v9.1.0/docs/en/images/audit-logs-core-3.png)
All application service methods and MVC controller actions are automatically logged and can be viewed here. See audit logs documentation to learn how to configure it. When we click the magnifier icon, we can see all details an audit log:
![Audit Log](https://raw.githubusercontent.com/aspnetzero/documents/v9.1.0/docs/en/images/audit-logs-detail-1.png)
Audit log report is provided by AuditLogAppService class.
Periodic Log Deletion
ASP.NET Zero has built-in periodic log deletion system. To enable it, go to *.Application/Auditing/ExpiredAuditLogDeleterWorker.cs
and set IsEnabled
to true;
public class ExpiredAuditLogDeleterWorker : PeriodicBackgroundWorkerBase, ISingletonDependency
{
...
public const bool IsEnabled = false;//default is false
...
It has two more parameter.
CheckPeriodAsMilliseconds: Time to wait between two controls.
MaxDeletionCount: The maximum number of records that can be deleted at once.
Note: To perform smaller operations with more frequent intervals you can decrease
MaxDeletionCount
andCheckPeriodAsMilliseconds
.