如何在 elmah 上使用服务器、Xml、电子邮件错误日志存储过程

发布于 2024-09-05 06:01:08 字数 1768 浏览 5 评论 0原文

使用elmah我可以在数据库、电子邮件、xml上保存错误日志。它们单独工作得很好。我想一起工作。假设在我的配置文件中我可以活动服务器日志而不是不能活动xml日志,但我想工作两者都可以。怎么办。

 <elmah>
        <!-- Change this to 1 to allow remote access. If you do, be sure to lock down the elmah.axd file! -->
        <security allowRemoteAccess="1" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ReviewsConnectionString" />

  <!--Storing errors in XML files-->
      <!--<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />-->

  <!--<errorMail
          from="[email protected]"
          to="[email protected]"
          subject="..."
          async="true"
          smtpPort="0"
          useSsl="true"
          />-->    
</elmah>

 <system.net>

      <mailSettings>
        <smtp deliveryMethod="Network">
          <network host="smtp.gmail.com"
          port="587"
          userName="xxixddixx"
          password="1234" />
          </smtp>
        </mailSettings>
 </system.net>

如果我在标签上使用服务器日志,那么它工作得很好,而不是我需要停用日志存储过程的其余部分,例如:xml、邮件通知等。如果我激活 Xml 日志,那么它工作得很好,而不是我需要停用其余的。但是如果我同时激活它们,那么它就不起作用**。我希望它们同时激活。如何同时激活它们。如果我激活**邮件日志它不起作用。我不知道为什么它不起作用。

**1) How to active Server log and Xml log on same time.
2) How to active email log with 1) and individually why it's not work?** 

我希望错误日志将保存在数据库中,以 xml 格式保存在指定文件夹中,并且还想如何发送电子邮件通知同时激活它们。

using elmah i can save error log on database,email,xml .They are individually works well .I want to work in together.Suppose in my config file i can can active server log than i can not active xml log but i want to work on both .How to do.

 <elmah>
        <!-- Change this to 1 to allow remote access. If you do, be sure to lock down the elmah.axd file! -->
        <security allowRemoteAccess="1" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ReviewsConnectionString" />

  <!--Storing errors in XML files-->
      <!--<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />-->

  <!--<errorMail
          from="[email protected]"
          to="[email protected]"
          subject="..."
          async="true"
          smtpPort="0"
          useSsl="true"
          />-->    
</elmah>

 <system.net>

      <mailSettings>
        <smtp deliveryMethod="Network">
          <network host="smtp.gmail.com"
          port="587"
          userName="xxixddixx"
          password="1234" />
          </smtp>
        </mailSettings>
 </system.net>

if i cative server log on tag it's work well than i need to deactivate rest of log storage process like : xml,mail-notification etc.If i active Xml log than it's work well than i need to deactivate rest of them .But if i active both of them then it does not work**.I want they active on same time.How to active them in the same time.if i active **mail log it does not work .I don't know why it's not work.

**1) How to active Server log and Xml log on same time.
2) How to active email log with 1) and individually why it's not work?** 

I want error log will save on database, save on specified folder as xml formate, and also want to send email notification how to active them in the same time.

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

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

发布评论

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

评论(1

苍暮颜 2024-09-12 06:01:08

我一直在寻找同样的原因 - 如果 SQL 数据库出现故障,我仍然想知道该错误。我看到了这个页面,它指出它不能直接通过配置实现,但是建议了一种实现它的方法。

这篇帖子

我使用了 SQL + 电子邮件日志记录的方法,因为两者不太可能同时不可用。

I was looking for the same reason- if the SQL database was down, I still wanted to know about the error. I came across this page, which states it's not directly possible via config, however suggests a way to achieve it.

There's also some detail on this post

I've used the approach of SQL + Email logging, given it's unlikely both will be unavailable concurrently.

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