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.
Inheritance
AuditAttribute
Implements
Namespace: PostSharp.Patterns.Diagnostics.Audit
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
[Obsolete("This feature has been moved to the sample PostSharp.Samples.Logging.Audit.")]
public class AuditAttribute : LogAttributeBase, IMethodLevelAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ILogAspect, IAspectRemarks
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. |