Hi, the problem that we're seeing is that application logging works fine
on our development machines, but fails on the production server. Our
application is an ASP.Net web application running on Windows 2000, IIS 5.0,
written in C#. The ASP.Net worker process is running under a restricted
account, and this account has been granted full control permissions on the
subdirectory for logging. For additional security, permissions for the
"Everyone" group has been removed from the C drive. We're performing logging
with the RollingLogFileAppender. 
    After downloading the source code, the problem was immediately evident.
In version 1.2.0 beta 8, in the FileAppender.cs file, line 208, the OpenFile
method attempts to create the directory every single time. However, the
ASP.Net worker process doesn't have permissions to do so in the parent
directory, so logging fails. To fix this problem, it would be better if the
OpenFile method checked for directory existence and create it if necessary,
with the following code snippet: 
 
string directory = (new FileInfo(fileName)).DirectoryName;
if (!Directory.Exists(directory))
    Directory.CreateDirectory(directory);
 
This way the process that performs the logging doesn't need permissions to
create the directory if it already exists. Thanks
- Mike 
 
________________________________

Mike Hagen
Analyst/Programmer IV
State of Alaska H&SS, DBH
[EMAIL PROTECTED]
(907) 465-2235 fax (907) 465-2185 

Reply via email to