设计一个分布式(跨多个服务器)错误日志记录功能,WCF 还是?

发布于 2024-07-08 18:06:45 字数 170 浏览 12 评论 0原文

我正在设计一个错误记录功能,以便我们的服务器(每个服务器都做不同的事情)可以有一个用于记录错误的中央数据存储。

让各种应用程序使用 WCF 服务写入错误日志文件是一个好主意还是一个坏主意?

他们可以仅通过ADO.NET 访问数据库来完成此操作,我认为这是更简单的途径。

I am designing a error logging feature so our servers (each donig different things) can have a central data store for logging errors.

Would it be a good idea to have the various applications writing to the error log file using a WCF service, or is that a bad idea?

they can do it just by ADO.NET to the database, which I think is the simpler route.

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

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

发布评论

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

评论(3

塔塔猫 2024-07-15 18:06:45

看一下系统日志怎么样? 它正是为了这个目的而设计的。

How about having a look at syslog? It was made for exactly that purpose.

一片旧的回忆 2024-07-15 18:06:45

我想说只需登录到您的本地数据存储即可。 优点是:

  1. 速度 - 速度相当快
    将您选择的错误报告转储到
    现有数据连接。
  2. 可追溯性 - 如果您
    您的服务有错误吗? 你
    失去所有追击能力
    所有服务器上的错误。
  3. 简单性 - 如果你改变
    您的错误服务的端点,
    你必须每隔一个更新一次
    使用错误的应用程序
    服务。
  4. 报告 - 你真的想要吗
    搜寻错误报告
    数十/数百个应用程序
    一个你可以轻松找到的地方
    它们位于本地数据存储中
    应用程序?

当然,这些观点都可以从另一个角度来看,这只是我的看法。

I'd say just log to your local data store. The advantages are :

  1. Speed - it's pretty rapid to just
    dump your chosen error report to an
    existing data connection.
  2. Tracability - What happens if you
    have an error in your service? You
    lose all ability to chase down
    errors on all servers.
  3. Simplicity - If you change the
    endpoint for your errors service,
    you have to update every other
    application that uses the error
    service.
  4. Reporting - Do you really want to
    trawl through error reports from
    tens / hundreds of applications in
    one place when you could easily find
    them in the data store local to the
    app?

Of course, any of these points could be viewed from the other side, these are just my opinions.

国际总奸 2024-07-15 18:06:45

我们正在研究类似的方法,但审计日志记录和错误处理除外。

考虑通过 netTcp 使用 WCF,还考虑使用事件日志,但这似乎需要高信任设置,并且可能存在性能问题。

不相信 ZombieSheep 的反对意见:

  1. 通过现有 WCF 连接转储您选择的错误报告非常快。 严重地。 另外,您可以异步/排队进行。 对我来说不是关键因素。

  2. 您登录到中央服务和本地服务。 当错误服务重新上线时,您将轮询计算机以查找自上次时间戳以来的事件。 问题解决了。

  3. 使用 dns 别名,并且不要更改路径 - IMO 中您应该执行内部寻址的方式。

    使用 dns 别名,并且不要更改路径

  4. 如果一台计算机上有多个应用程序怎么办? 如果您想查看多个应用程序中的错误时间该怎么办?

We're looking at a similar approach, except for audit logging as well as error handling.

Looking at using WCF over netTcp, also looking at using the event log, but that seems to require high trust settings, and maybe performance issues.

Not convinced by ZombieSheep's objections:

  1. It's pretty rapid to dump your chosen error report over an existing WCF connection. Seriously. Plus, you can do it async/queued. Not a key factor for me.

  2. You log to the central service and the local service. When the erroer service comes back on line, you poll your machines for events since the last timestamp. Problem solved.

  3. Use a dns alias, and don't change the path - the way you should do internal addressing anyway IMO.

  4. What if you have multiple apps on a single machine? What if you want to see the timing of errors across multiple apps?

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