12

After installing elmah.mvc from nuget:

where is the log file created by default?

Errors are logged just fine when I go to /myapp/elmah however I don't see where the actual log file resides. thanks

ShaneKm
  • 20,823
  • 43
  • 167
  • 296

2 Answers2

20

Look at the bottom of the myapp/elmah page for "This log is provided by the..." to see what type of logging you're using. If it's In-Memory, there is no physical file. Otherwise, the location of the file is specified by logPath in web.config, such as...

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

EDIT

I don't want to just replace the original code snippet because it might have worked for some people; for me it didn't and actually I had to change logPath a bit like that:

 <elmah>
  <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
 </elmah>
Ofer Zelig
  • 17,068
  • 9
  • 59
  • 93
Russ Swift
  • 218
  • 2
  • 6
  • 2
    After I added that the xml files would still not show up until I added write permissions and made App_Data folder NOT read only. thanks – ShaneKm Jul 17 '13 at 08:34
  • @ShaneKm Can you update your question with all the changes you have done? like how did you made that folder not read only and gave write permissions etc. – Unnie Feb 23 '15 at 14:45
  • I found that the App_Data folder is not the one in the MVC project but the one under IIS Express. For me it was 'C:\Program Files (x86)\IIS Express\~\App_Data' – user3885927 Nov 24 '15 at 19:45
0
<configSections>
    <sectionGroup name="elmah">
      <section name="errorLog" type="Elmah.ErrorLogSectionHandler, Elmah" />
    </sectionGroup>
  </configSections>

  <elmah>
    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="\\Mydocs\Logs" />
  </elmah>
Melu
  • 1,835
  • 3
  • 14
  • 13