Class AuditEntryService
Represents a service for handling audit entries.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public class AuditEntryService : RepositoryService, IAuditEntryService, IService
Constructors
View SourceAuditEntryService(IAuditEntryRepository, IUserIdKeyResolver, ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory)
Initializes a new instance of the AuditEntryService class.
Declaration
public AuditEntryService(IAuditEntryRepository auditEntryRepository, IUserIdKeyResolver userIdKeyResolver, ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| IAuditEntryRepository | auditEntryRepository | |
| IUserIdKeyResolver | userIdKeyResolver | |
| ICoreScopeProvider | provider | |
| ILoggerFactory | loggerFactory | |
| IEventMessagesFactory | eventMessagesFactory |
Methods
View SourceWriteAsync(Guid?, string, string, DateTime, Guid?, string?, string, string)
Writes an audit entry for an audited event.
Declaration
public Task<IAuditEntry> WriteAsync(Guid? performingUserKey, string performingDetails, string performingIp, DateTime eventDateUtc, Guid? affectedUserKey, string? affectedDetails, string eventType, string eventDetails)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid? | performingUserKey | The key of the user triggering the audited event. |
| string | performingDetails | Free-form details about the user triggering the audited event. |
| string | performingIp | The IP address or the request triggering the audited event. |
| DateTime | eventDateUtc | The date and time of the audited event. |
| Guid? | affectedUserKey | The identifier of the user affected by the audited event. |
| string | affectedDetails | Free-form details about the entity affected by the audited event. |
| string | eventType | The type of the audited event - must contain only alphanumeric chars and hyphens with forward slashes separating
categories.
|
| string | eventDetails | Free-form details about the audited event. |
Returns
| Type | Description |
|---|---|
| Task<IAuditEntry> | The created audit entry. |