Elmah – Not generatting XML Log File

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.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s