Tag Archives: AOP

Errors handling and logging in ASP.NET MVC

How to handle errors and exception in ASP.NET MVC applications the right way.
I want the following:
– All the errors and exceptions must be logged
– Logging should be easy to program and it should not influence main code flow
– Error log must contain call stack and time stamp
– User should receive a friendly error page.
Sample project for Visual Studio 2015 can be downloaded here https://github.com/mchudinov/AspMvcErrorHandler
error404
Continue reading

Logging in .NET with AOP using PostSharp

Here is a simple application that logs to console. Logging is programmed with Aspect Oriented Programming paradigm as an aspect using PostSharp. As a logger library I use log4net.

postsharp

Sample solution can be downloaded from here https://github.com/mchudinov/LoggingPostSharp. It is compatible with Visual Studio 2012, MonoDevelop 5, and Xamarin Studio 5.
Continue reading