Is there a recommended logging path/folder for ASP.NEt applications?
Currently we use log4net and create a new folder (usually below C:) with write and create access rights for the worker process user. Is there perhaps a standard windows folder we should or could be using such as LOCALAPPDATA? I'm guessing that LOCALAPPDATA is a bad choice in the general case because IIS users tend to be non-interactive users a开发者_如何学Cnd thus I don't think they have the usual user folder structrues available.
Put your logs in the App_Data folder below your web site root.
Microsoft guidance: To improve the security of the data used by your ASP.NET application, a new subfolder named App_Data has been added for ASP.NET applications. Files stored in the App_Data folder are not returned in response to direct HTTP requests, which makes the App_Data folder the recommended location for data stored with your application, including .mdf (SQL Server Express Edition), .mdb (Microsoft Access), or XML files. Note that when using the App_Data folder to store your application data, the identity of your application has read and write permissions to the App_Data folder.
I would not use c:\ at all. You never know how big your logfiles may grow and one day your System Partition is full.
Other then that I don't know of a standard logging folder, but why not use the Database?
Perhaps you might consider logging to a directory inside the app root. There the worker process certainly has permissions and the log data will be easily discoverable, perhaps even servable.
精彩评论