PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​AuditAudit­Attribute
Open sandboxFocus

AuditAttribute Class

Custom attribute that, when applied to a method, causes PostSharp to audit execution of this method. Whenever an audited method is executed, the RecordPublished event is raised. You need to register your own logic to the RecordPublished event, for instance to append the record to a database table.

Namespace: PostSharp.Patterns.Diagnostics.Audit
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
public class AuditAttribute : LogAttributeBase, IMethodLevelAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ILogAspect, IAspect
Remarks

Audit is a special kind of logging. The AuditAttribute aspects adds logging with the Audit profile, which is by default served by the AuditBackend back-end, which exposes a simple API to the AuditServices class.

The AuditAttribute aspect can be used side-by-side with the LogAttribute aspect.

Constructors

Name Description
AuditAttribute()

Initializes a new AuditAttribute.