ELMAH.axd 可以浏览,但永远不会记录我的任何错误?

发布于 2024-08-16 16:23:19 字数 1179 浏览 5 评论 0原文

我已经全部设置完毕,我可以浏览到 /elmah.axd 但我一直在造成所有这些错误,它不会记录任何错误,它只是说“没有记录错误”...我到底做了什么错误的?

以下是我添加到 web.config 中的内容:

<configSections>
  <sectionGroup name="elmah">     
        <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />     
        <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />     
        <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />     
  </sectionGroup>
</configSections>

<httpHandlers>
  <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>

<httpModules>
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />  
</httpModules>

<elmah>
  <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
  <security allowRemoteAccess="yes" />
</elmah>

另外:这已经在我的 RegisterRoutes() 的开头,

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

我读到它与 ASP.NET MVC 1.0 无关了,据说(根据 ELMAH 网站)。 ..)

I have it all set up and I can browse to /elmah.axd but I have been causing all these errors and it won't log any of them, it just says 'no errors logged'... what the heck did I do wrong?

Here is the stuff I have added to my web.config:

<configSections>
  <sectionGroup name="elmah">     
        <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />     
        <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />     
        <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />     
  </sectionGroup>
</configSections>

<httpHandlers>
  <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>

<httpModules>
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />  
</httpModules>

<elmah>
  <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
  <security allowRemoteAccess="yes" />
</elmah>

ALSO: This was already at the start of my RegisterRoutes()

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

I read that it doesn't matter any more with ASP.NET MVC 1.0 though, supposedly (per ELMAH website...)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

星軌x 2024-08-23 16:23:19

配置似乎是有序的;我最好的猜测是您的 IIS Web 应用程序用户没有写入 App_Data 的权限。如果您已锁定权限,则应用程序用户将具有读取权限,但不具有写入权限。

您可以打开权限或登录到 Web 路径之外的另一个目录(IMO 更安全),并确保在那里设置用户的读/写权限。

The config seems to be in order; my best guess is that your IIS web application user doesn't have permission to write to App_Data. If you've locked down permissions, the application user will have read, but not write, permissions there.

You can open permissions up or log to another directory outside of the web path (which is a bit safer IMO) and make sure that read/write permissions for the user are set there.

江城子 2024-08-23 16:23:19

我从 nuget elmahelmah on XML log 安装的解决方案配方

,虽然我可以访问 http://localhost/elmah,但没有获得预期的功能。 axd,但捕获时没有错误。

我向 APP_DATA 文件夹中的帐户 IIS_IUSERS 授予了写权限,它开始处理 HTTP 404 错误和 MVC 基础结构之外的错误。但它没有记录 mvc 内部的异常。解决方案是从 nuget 安装 elmah.mvc 包,它开始捕获所有异常。

如果你的配置没问题,那么只需从 nuget 安装 elmah.mvc 包,它就会开始在 mvc 内存储日志,而不仅仅是 HTTP 404。

The Solution recipe

I installed from nuget elmah and elmah on XML log, didn't got the expected funcionality although I could access http://localhost/elmah.axd, but no error capturing.

I gave write permission to the account IIS_IUSERS in the folder APP_DATA and it started working for HTTP 404 errors and the errors that are outside MVC infrastructure. But it did not log exceptions inside the mvc. The solution was installing elmah.mvc package from nuget and it started capturing all exceptions.

If your config is OK, then just install the elmah.mvc package from nuget and it should start storing logs also inside mvc, not just HTTP 404.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文