# Abp Audit Logging

> ABP Framework v10.4 audit logging: AbpAuditingOptions, entity history, IAuditingStore, audit log storage and filtering. Use when configuring audit trails, audit logs, or entity history in ABP.

- **Type:** Skill
- **Install:** `agentstack add skill-burakdmir-abp-skills-abp-audit-logging`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [burakdmir](https://agentstack.voostack.com/s/burakdmir)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [burakdmir](https://github.com/burakdmir)
- **Source:** https://github.com/burakdmir/abp-skills/tree/main/opencode/abp-audit-logging
- **Website:** https://abp.io/docs/latest

## Install

```sh
agentstack add skill-burakdmir-abp-skills-abp-audit-logging
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# ABP Audit Logging Skill

## Trigger
Audit logging, audit trails, entity history, AbpAuditingOptions, IAuditingStore, tracking changes.

---

## Quick Reference

### Configuration
```csharp
Configure(options =>
{
    options.IsEnabled = true;
    options.IsEnabledForGetRequests = false;
    options.ApplicationName = "MyApp";
    options.EntityHistorySelectors.AddAllEntities();
});
```

### Entity History (OFF by default — must enable explicitly)
```csharp
// All entities
options.EntityHistorySelectors.AddAllEntities();

// Specific entities
options.EntityHistorySelectors.Add(new NamedTypeSelector("MySelector",
    type => typeof(IEntity).IsAssignableFrom(type)));

// Per entity
[Audited] public class MyEntity : Entity { }
[DisableAuditing] public class SecretEntity : Entity { }

// Specific properties
[DisableAuditing] public string Password { get; set; }
[Audited] public string Name { get; set; }  // Only log this
```

### Disable Auditing
```csharp
[DisableAuditing] public class MyController : AbpController { }
[DisableAuditing] public async Task DoWorkAsync() { }
```

### IAuditingStore (custom implementation)
```csharp
public class MyStore : IAuditingStore, ITransientDependency
{
    public async Task SaveAsync(AuditLogInfo auditInfo) { /* custom storage */ }
}
```

### Contributors
```csharp
public class MyContributor : AuditLogContributor
{
    public override Task PreContributeAsync(AuditLogContributionContext ctx)
    {
        ctx.AuditLog.ExtraProperties["CorrelationId"] = CorrelationId;
        return Task.CompletedTask;
    }
}
Configure(o => o.Contributors.Add());
```

### AlwaysLog Selectors
```csharp
options.AlwaysLogSelectors.Add(new NamedTypeSelector("Critical",
    type => typeof(ICriticalService).IsAssignableFrom(type)));
```

### ASP.NET Core Options
```csharp
Configure(o =>
{
    o.IgnoredUrls.Add("/health");
});
```

### AuditLogInfo Key Fields
- UserId, TenantId, ExecutionTime, ExecutionDuration
- ClientIpAddress, BrowserInfo, HttpMethod, Url
- ExceptionMessage, EntityChanges, EntityPropertyChanges

### Best Practices
- Entity history OFF by default — enable explicitly
- Use AddAllEntities() only if needed (storage intensive)
- Disable auditing on sensitive properties (passwords, tokens)
- Set ApplicationName for multi-app audit databases
- Don't log GET requests unless debugging
- Monitor storage growth with entity history
- Blazor Server entity history has known limitations (#11682)

## Related

[Infrastructure](../abp-infrastructure/SKILL.md) · [DDD](../abp-ddd/SKILL.md) · [Multi-Tenancy](../abp-multitenancy/SKILL.md) · Docs: https://abp.io/docs/latest/framework/infrastructure/audit-logging

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [burakdmir](https://github.com/burakdmir)
- **Source:** [burakdmir/abp-skills](https://github.com/burakdmir/abp-skills)
- **License:** MIT
- **Homepage:** https://abp.io/docs/latest

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-burakdmir-abp-skills-abp-audit-logging
- Seller: https://agentstack.voostack.com/s/burakdmir
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
