3

I have integrated Elmah.mvc via Nuget in my mvc application. It is storing logs properly but when i do any changes in web.config or restart the site all the error logs stored are erased. Is there a way to preserve its logs permanently in some location probably inside project folder or somewhere. Pls suggest.

meenu
  • 53
  • 3

1 Answers1

2

Yes! All you have to do is tell Elmah to record logs in files instead of in memory, like this (in elmah's web.config session):

<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />

to save in memory it should be:

<errorLog type="Elmah.MemoryErrorLog, Elmah" size="1000"/>

Don't forget to allow write access on "logPath" folder.