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

有帮助吗?

解决方案

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>

其他提示

<configSections>
    <sectionGroup name="elmah">
      <section name="errorLog" type="Elmah.ErrorLogSectionHandler, Elmah" />
    </sectionGroup>
  </configSections>

  <elmah>
    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="\\Mydocs\Logs" />
  </elmah>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top