How can we implement log4net in asp.net mvc application? [Resolved]

Posted by Poojawadekar under ASP.NET on 7/26/2016 | Points: 10 | Views : 156 | Status : [Member] | Replies : 2
I want to implement log4net logging technique in asp.net mvc application. How can we achieve it?
Also can we implement automatic logging by just some setting in web.config. i.e when error caught it will automatically logged in file instead of writting every where log.error("Error Message!"); in catch. I f anyone knows please post?




Responses

Posted by: Bhuvanesh6 on: 7/26/2016 [Member] Starter | Points: 50

Up
0
Down

Resolved
Please refer to this link, its simple and clearly explained.

http://www.c-sharpcorner.com/UploadFile/33b051/how-to-use-log4net-in-mvc-to-track-error/

Here you go with each steps along with screen shots.

Bhuvan

Poojawadekar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhuvanesh6 on: 7/26/2016 [Member] Starter | Points: 25

Up
0
Down
Simple Steps in High level:

Connect to the Nuget Management console
Download/Add to project [Nuget for Log4Net] assembly
Make the configuration changes in App.config/web.config file
Declare the Log4Net in the controller code
Use the logger object created in the code where ever required.


Bhuvan

Poojawadekar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response