0

I have developed asp.net MVC web application using visual studio 2013.

I have created a web deploy package using publish option in visual studio 2013. Deployed web package on IIS 8.

Application is up and running without any errors. But my concern is the application logs are not getting logged on server but everything was working in development environment.

I have done following :

  • Created logs folder to log logs under a root folder as it was not created by package deploying by default.

    • folder Security setting tab : provided Read and write permissions on logs folder for appPool.
  • Web.config I have given a correct root folder path with file name need to be created in logs folder.

I used log4net for logging.

AnneRaNa
  • 51
  • 10

1 Answers1

1

First of all it's not recommended to write any files in the root folder as writing will cause appdomain to recycle after certain number of rights (default is 15) causing session loss. See more details here.

I would suggest you to add a path of your server to web.config and then pass it to log4net service.Use something like below in the appsettings section of web.config

<add key="log4netpath" value="C:\inetpub\xyz_Logs\webapp" />

Make sure the path is outside the root folder. Uae this path in the init() method of your log4net service while initializing log4net.

On the permissions side make sure you give full permissions to Users group on your server.

Community
  • 1
  • 1
Ravi A.
  • 2,163
  • 2
  • 18
  • 26