• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

location of a log file in asp.net 2.0

In ASP.NET 2.0 with C# When I have error I show an error page for the user and I also write all the details of the error into a log file for the managers of the site.
This file is located in "~/logs/ErrorLogWS.txt".
In order to write to this file I had to give permissions to the USER group in the IIS otherwise the writing was denied. Is it O.k. to put the errorlog in the place of the site or is their another recomendation.
1 Solution
I'd recommend granting the ASP.NET Worker Process write access, and not the ISUR_<computer> account you mention in the post.

To answer your question though, I don't personally see an issue with storing the log file within the web application directory.  Of course if you have custom deployment packages or something you have to be careful something else isn't going to blow away that directory (and remove your log files).

Regardless, I usually store the logs under a directory like C:\Logs\ so I can find and refer to them quicker in a production app.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now