How do I configure my ASP.NET directory to allow writing a log file?-Collection of common programming errors

This should help:

To grant read, write, and modify permissions to a specific file

In Windows Explorer, locate and select the required file.

Right-click the file, and then click Properties.

In the Properties dialog box, click the Security tab.

On the Security tab, examine the list of users. If the Network Service account is not listed, add it.

In the Properties dialog box, click the Network Service user name, and in the Permissions for NETWORK SERVICE section, select the Read, Write, and Modify permissions.

Click Apply, and then click OK

information from: http://msdn.microsoft.com/en-us/library/ff647402.aspx#paght000015_fileaccess