On adding Elmah to my web app (logging to XML files) I noticed that error logging worked fine on my development machine but when deployed to a server nothing was being logged.
First thing I did was check that logging was working on the server by removing the errorLog setting in my web.config and trying it -
<elmah>
<security allowRemoteAccess=”yes” />
<errorLog type=”Elmah.XmlFileErrorLog, Elmah” logPath=”~/ErrorLogs” />
</elmah>
Removed the line and logging (in memory) was working. OK so the problem has to be with creating the log file itself. Digging around provided some clues and suggestions about folder access.
In the end I needed to give ‘Modify’ permission on the ‘ErrorLogs’ folder on the web server to the user account my site was running as. This could be the IIS user account. For me it was the account my App Pool was running as I had my site assigned to an Application Pool.