logging - How do I set up log4net for Asp.NET MVC application -
We have a handful of MVC applications and what special ideas I am wandering there. In the applications of regular web forms, we try to capture the code behind too many bus straps. But it looks less clear with MVC as an assistant, controller, route etc. I should make sure that there is logging.
Usually you will apply logging to your controller tasks by adding the error logging to the HandleError attribute You can also create custom actions / results filters to automate some types of logging. With such filters, you can apply it to your base controller and do some basic logging / instrumentation for all operations.
If you customize the structure with controlling factories, action invovers or model binders, then you also apply logging there. Of course, this is your actual model (domain object, external services, persistence and databases, security Etc.) have nothing to say about how to implement logging.
Comments
Post a Comment