PostSharpAPI ReferencePost­Sharp.​Patterns.​DiagnosticsLog­Attribute
Open sandboxFocus

LogAttribute Class

Custom attribute that, when applied on a method, causes PostSharp to implement tracing before and after execution of this method.

Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics.dll
public class LogAttribute : LogAttributeBase, IMethodLevelAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ILogAspect, IAspect

By default, the current custom attribute follows the settings of the default profile, which adds a Debug message on entry and on success, and a Warning on exception. All messages include parameter values. You can change these default settings by setting the properties of this class, or by choosing a different logging profile. The values set to properties in this class override the values set by the logging profile.


Name Description

Initializes a new LogAttribute.


Initializes a new LogAttribute and specifies a logging profile.