Class AuditOptions
Configuration for audit logging.
public class AuditOptions
- Inheritance
-
AuditOptions
- Inherited Members
Properties
BatchSize
Batch size for background MongoDB writer. Default: 100.
public int BatchSize { get; set; }
Property Value
CallerFilter
Which caller sources to log. Default: Api and Web.
public AuditCallerFilter CallerFilter { get; set; }
Property Value
DefaultAuditMode
What a scope- or access-level-checked call records when its attribute says nothing. Default: Access — every such call is traced, as it always has been.
public AuditMode DefaultAuditMode { get; set; }
Property Value
Remarks
Set this to None to make silence the default and record by exception.
A host under privacy rules that treat broad read logging as a hazard wants exactly that: nothing is
recorded unless a method asks for it with [RequireScope(..., Audit = AuditMode.Access)], so
adding a method cannot silently start recording who read what.
Why this is not the shipped default. Flipping it centrally would end the access trace of every existing host with no compile error and nothing in a diff to notice — an audit trail that quietly stopped several releases ago. The choice belongs to the host, taken once and visibly.
This governs entries the enforcement proxies write. It does not touch ExcludedActions, EventFilter or CallerFilter, which still filter whatever is produced — and it never suppresses a denial.
EventFilter
Which event types to log. Default: All.
public AuditEventFilter EventFilter { get; set; }
Property Value
ExcludedActions
Actions to exclude from logging (e.g. "read", "list", "get"). Default: empty.
public string[] ExcludedActions { get; set; }
Property Value
- string[]
ExcludedEndpoints
Endpoints to exclude from logging (e.g. "/health"). Default: empty.
public string[] ExcludedEndpoints { get; set; }
Property Value
- string[]
FlushIntervalSeconds
Flush interval for background MongoDB writer in seconds. Default: 5.
public int FlushIntervalSeconds { get; set; }
Property Value
RetentionDays
Days to retain audit entries in MongoDB, applied as a TTL index (Timestamp_TTL). Default: 90.
null (or any value <= 0) means keep forever — no TTL index is created. Note: removing
or changing the TTL on an existing collection may require dropping the old Timestamp_TTL
index manually, as MongoDB does not drop it automatically.
public int? RetentionDays { get; set; }
Property Value
- int?
StorageMode
Where to store audit entries. Default: Logger only.
public AuditStorageMode StorageMode { get; set; }