ELMAH 具有多种应用
刚刚让 ELMAH 运行起来,到目前为止看起来很棒。我想知道两件事:
我正在多个应用程序中使用 ELMAH,所有应用程序都记录到 MSSQL 中的同一个表。我是否能够将 .axd 文件拖放到任何项目中来浏览所有日志,还是需要自定义解决方案? (后者似乎更有可能,所以我可以有过滤选项,但我只是想验证一下。)
elmah.axd 是否可以以某种方式自定义?我宁愿修改它,也不愿自己编写,这样我就可以将 ApplicationName 列添加到其列表中。
Just got ELMAH running, and so far it seems great. I am wondering two things:
I am using ELMAH from multiple applications, all logging to the same table in MSSQL. Will I be able to drop the .axd file in any project to browse all the logs, or will I need a custom solution? (The latter seems more likely, so I can have filtering options, but I'm just trying to verify.)
Is elmah.axd somehow customizeable? I'd rather modify it than write my own, so that I could add the ApplicationName column to its listing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们刚刚在 codeplex 上发布了基于 ELMAH 的异常报告解决方案: http://aspexceptionreporter.codeplex.com/
一其功能之一是它将多个网站的错误记录到一个中央位置。该项目包括一个用于查看和搜索错误的网站。
We just released our ELMAH based exception reporting solution on codeplex: http://aspexceptionreporter.codeplex.com/
One of the features is that it logs errors of multiple web sites to a central location. The project includes a web site to view and search through the errors.
默认情况下,ELMAH 设置为找出它在哪个应用程序下运行,并根据该应用程序过滤显示的错误。因此,对于您的问题 1,不,您将无法从应用程序调用 .axd 并查看所有应用程序的错误。至少在没有一些额外工作的情况下是这样。另请参阅此相关问题。
至于问题2,默认查看器并不是为了“定制”而设计的。我的意思是,您无法为其提供任何标记参数来更改它显示的列。不过,ELMAH 本身是开源的,因此您可以轻松下载源代码并构建定制版本。我首先看一下 ErrorLogPage.cs,它是“渲染 HTML 页面,显示错误日志中的错误页面”的类。
ELMAH, by default, is set up to figure out under which application it is running and will filter the displayed errors based on that application. So, as for your question 1, no, you won't be able to call the .axd from an app and see the errors for all apps. At least not without some extra work. See also this related question.
As for question 2, the default viewer is not designed to be "customized". By that, I mean there aren't any markup parameters you can give it to change the columns it displays. ELMAH itself is open source, though, so you can easily download the source and build a customized version. I would start by having a look at ErrorLogPage.cs, which is the class that "Renders an HTML page displaying a page of errors from the error log."