Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running an ASP.NET MVC web app on IIS7 on Windows Server 2008. In order to allow my log files to be written to the application directory (under \WebSites), I have given the DefaultAppPool write permissons to the folder.

This worked fine, until a day or so later, my log files stopped showing up in the application directory. I checked the permissions and I still saw Write was allowed for the DefaultAppPool. I redeployed the website and updated the security settings again, and my log files were once again able to be written.

Does this seem strange to anyone else? Is there something I need to do to get these security settings to stick?

Thanks!

share|improve this question

2 Answers 2

If the application was trying to write to the directory, but didn't have the correct permissions, an exception would be thrown. If you're catching that exception and not doing anything with it, you're out of luck for determining what the issue was (and you might want to think about letting that exception bubble up).

But, if your application was dieing when it was attempting to write to the log, you might be able to dig up some information from the Event Viewer. When you load the Event Viewer, go to Windows Logs/Application and then look for events with a source of ASP.NET X.X (where X.X is your version).

Aside from that you might want to make sure nobody else changed the permissions.

share|improve this answer
    
The application is healthy. I checked out the event logs and can see the requests returning 200. The weird thing is that the DefaultAppPool still has Write permisson when the log files stop showing up. Redeploying the application resets the permissions; when I update the permissions following redeployment, the files appear again. –  Paul Mar 14 '12 at 17:11

I found the issue. The DefaultAppPool was OK to create the file within the log package I'm using (NLog) with just Write permission, but later on (I'm gussing when it tried to roll over the log at the end of the day) it needed Modify permissions too. Once I added Modify permission to the DefaultAppPool I was good.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.