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
Continue reading
Tag Archives: logging
Logging in .NET Mono on Linux and Windows using NLog
Here is a simple application that will log to console and syslog demon. On Windows platform we can use free edition of Kiwi Syslog Server. On Linux application will use both local and remote syslog. As a logger library I use NLog.
Sample solution can be downloaded from here https://github.com/mchudinov/LoggingNLog. It is compatible with Visual Studio 2012, Mono Develop 5, and Xamarin Studio 5.
Continue reading
Using Decorator pattern in .NET C#
Here is a simple application that demonstrates using of decorator pattern in C#.
Sample solution can be downloaded from here https://github.com/mchudinov/LoggingDecorator. Solution is compatible with Visual Studio 2012, MonoDevelop 5, and Xamarin Studio 5.
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.
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
Logging in .NET Mono on Linux and Windows using log4net
Here is a simple application that will log to console and syslog demon. On Windows platform we can use free edition of Kiwi Syslog Server. On Linux application will use both local and remote syslog. As a logger library I use log4net.
Sample solution can be downloaded from here https://github.com/mchudinov/Logging. It is compatible with Visual Studio 2012, Mono Develop 5, and Xamarin Studio 5.
Continue reading