A PostSharp aspect that logs exceptions after they are thrown when they cause a method to exit. This allows for logging of handled as well as unhandled exceptions.
You can associate the GException attribute with a single method, a property, or an entire class to monitor all methods in that class. You can also use attribute multicasting to apply it to all matching methods in your assembly.
Monitor one method within a class
public class SampleApplication
{
[GException]
private void InterestingMethod(int valueOne, String anotherValue)
{
//Do something interesting here
}
}
Monitor all methods within a class
[GException]
public class SampleApplication
{
private void InterestingMethod(int valueOne, String anotherValue)
{
//Do something interesting here
}
private void AnotherInterestingMethod(int valueTwo, String anotherValue)
{
//Do something even more interesting here
}
}
System.Object
System.Attribute
PostSharp.Extensibility.MulticastAttribute
PostSharp.Aspects.Aspect
PostSharp.Aspects.MethodLevelAspect
PostSharp.Aspects.OnMethodBoundaryAspect
Gibraltar.Agent.PostSharp.GAspectBase
Gibraltar.Agent.PostSharp.GException
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2