Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logging and tracing on mvc4

I would like to know what are my options for logging and tracing in mvc4, in my old days I used to use external frameworks, I remember I used log4net many times and also the enterprise library.

I am looking an easy way that I can enable/disable logging and tracing to improve performance. So I would enable logging/tracing only when an unknown exception is occuring.

As I come from the Sharepoint world, there, you can configure different logging levels, verbose, monitorable, high, exceptions, etc.

I wonder if I can do the same with asp.net mvc.

like image 461
Luis Valencia Avatar asked Dec 21 '25 15:12

Luis Valencia


1 Answers

You should be able to use log4net without problems.

We use a different logger, NLog, which definitely works with ASP.NET. It has specific examples for ASP.NET

Here's a blog entry about using NLog with ASP.Net.

like image 131
Matthew Watson Avatar answered Dec 23 '25 06:12

Matthew Watson