查看 elmah 日志而不创建角色/用户身份验证
我开始使用 ELMAH,我认为它很棒。我在线阅读了一些文档,但现在我的应用程序没有角色/用户授权设置。
我希望能够通过访问 /elmah.axd 来读取生产上的错误日志,但我不想只向所有人开放它,elmah 是否有任何功能允许我创建密码(在 web.xml 中)。配置)并通过查询字符串传递它?模仿“安全”RSS 提要。或者类似的东西当然......
I started using ELMAH and I think its great. I read some documentation online but right now my app doesn't have roles/user authorization setup.
I would like to be able to read the error logs on production by accessing /elmah.axd but I don't want to just open it up to everyone, does elmah have any functionality that would allow me to create a password (in web.config) and pass it via querystring? Mimicking a "secure" RSS feed. Or something similar ofcourse....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上配置表单身份验证并不难:
然后保护
elmah.axd
:最后你可以拥有一个
AccountController:
和一个
LogOn.cshtml
视图:现在,当匿名用户尝试访问
/elmah.axd
时,他将看到登录屏幕,需要在其中进行身份验证命令访问它。用户名/密码组合位于web.config
中。我在本示例中使用了passwordFormat="Clear"
,但您也可以对密码进行 SHA1 或 MD5 处理。当然,如果您不想配置身份验证,您也可以配置 elmah 将日志信息存储在 XML 文件或 SQL 数据库中,然后从您的公开网站完全禁用 elmah.axd 处理程序。然后创建另一个 ASP.NET 站点,只有您可以使用指向相同日志源的相同 elmah 配置访问该站点,然后只需导航到您的私有站点的 /elmah.axd 处理程序即可读取公共站点的日志。
Actually it's not that hard to configure forms authentication:
and then protect
elmah.axd
:and finally you could have an
AccountController
:and a
LogOn.cshtml
view:Now when an anonymous user tries to access
/elmah.axd
he will be presented with the logon screen where he needs to authenticate in order to access it. The username/password combination is inweb.config
. I have usedpasswordFormat="Clear"
in this example but you could also SHA1 or MD5 the password.Of course if you don't want to configure authentication you could also configure elmah to store logging information in a XML file or SQL database and then completely disable the elmah.axd handler from your publicly facing website. Then create another ASP.NET site which only you would have access to with the same elmah configuration pointing to the same log source and simply navigate to the /elmah.axd handler of your private site to read the logs of your public site.