Guides

AuditLogService

Describes the AuditLogService

The AuditLogService is intended to be used to log Merchello related informational records that would not otherwise be normally recorded in an application's generic logging system.

Examples are

Payment authorized, Shipment Shipped and Order created records.

Instantiating

var auditLogService = MerchelloContext.Current.Services.AuditLogService;
The AuditLogService is exposed through the MerchelloContext

Class

public class AuditLogService : PageCachedServiceBase<IAuditLog>, 
	IAuditLogService, IPageCachedService<IAuditLog>, IService

Constructors

NameDescription
AuditLogService()Initializes a new instance of the AuditLogService class.
AuditLogService(ILogger)Initializes a new instance of the AuditLogService class.
AuditLogService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger)Initializes a new instance of the AuditLogService class.

Public Methods

NameDescription
CreateAuditLogWithKey(String, ExtendedDataCollection, Boolean, Boolean)Creates an audit record and saves it to the database
CreateAuditLogWithKey(Nullable(Guid), EntityType, String, Boolean, Boolean)Creates an audit record and saves it to the database
CreateAuditLogWithKey(Nullable(Guid), Nullable(Guid), String, Boolean, Boolean)Creates an audit record and saves it to the database
CreateAuditLogWithKey(Nullable(Guid), EntityType, String, ExtendedDataCollection, Boolean, Boolean)Creates an audit record and saves it to the database
CreateAuditLogWithKey(Nullable(Guid), Nullable(Guid), String, ExtendedDataCollection, Boolean, Boolean)Creates an audit record and saves it to the database
Delete(IAuditLog, Boolean)Deletes a IAuditLog
Delete(IEnumerable(IAuditLog), Boolean)Deletes a collection of IAuditLog
DeleteErrorAuditLogsDeletes all error logs
GetAuditLogsByEntityKeyGets a collection of IAuditLog for a particular entity
GetAuditLogsByEntityTfKeyGets a collection of IAuditLog for an entity type
GetByKeyGets an IAuditLog by it's key
GetErrorAuditLogsGets a collection of IAuditLog where IsError == true
GetPageGets a Page of AuditLogs

Events

NameDescription
CreatingOccurs before create
CreatedOccurs after create
DeletingOccurs before delete
DeletedOccurs after delete
SavingOccurs before saving
SavedOccurs after saved

Interface on GitHub

https://github.com/Merchello/Merchello/blob/master/src/Merchello.Core/Services/Interfaces/IAuditLogService.cs