Registration for the web application

I'm in the middle of building a fairly large site using asp.net (forms if it's of any interest) and I'm wondering if I need a logging framework like log4net. I've used frameworks like this before, but I don't see how I could use it in this type of project. I usually think logging is necessary for a client-supplied application where the log can be sent back and then analyzed for errors. what do you think?

+1


source to share


4 answers


Heck no-logging is incredibly important for web applications. If you register properly, it makes troubleshooting easier.

Log4Net is probably a good bet as a foundation. You may also need a way to collect logs along with multiple servers - and even if you don't use more than one server at the moment, you should probably assume that you will do so at some point.



One option for centralization is to copy the logs to the database - see this question for more opinions on this front.

+6


source


Logs are essential for all types of applications. If you submit your application, whether customer supplied or internally, whether it is web forms or smartclient / windows application logging / tooling applications, forms its basis.

How does the end user of your application know that the application is working as expected? What happens if any error occurs? How will the production team diagnose errors? How does the end user / admin actively analyze the application and prevent possible future problems?

Since you are using ASP.net, I recommend that you also take a look at the ASP.net Health Monitor features.



You can write your own events and providers for different types of logging and configure it for use in sync / async mode.

You can use log4net or an enterprise logging unit in conjunction with Health Monitor and could create a complete logging / instrumentation solution with minimal effort.

+2


source


I would of course vouch for the enterprise information sink (I think this is the correct name, this is the Microsoft api for logging) or the Enterprise Library.

I use the latter for all sorts of things like caching, logging, etc. and it's a very powerful time-saving tool. I also use health monitoring. This is for a large web app I'm building.

You're spoiled for choice when it comes to getting into .NET and these two suggestions are good.

+1


source


Logging is required if you need to know how the application works, when errors occur, who used the application and how (ip address, time, link, ...)

Most people use it to track the execution of a program so they can answer questions such as "why did it stop working?", "When did it stop working?" and etc.

If you know the application code is too good and you can easily reproduce the problems, I think there is a log for you :)

+1


source







All Articles