错误日志数据库——适用于许多应用程序

发布于 2024-08-16 18:17:58 字数 363 浏览 5 评论 0原文

我有一堆现有的客户端/服务器应用程序,目前正在运行。有时,客户会希望添加某种类型的 Web 界面来访问其部分数据。这些通常是定制的,尽管有些是“通用的”;但每个人在自己的虚拟机中都有自己的“实例”。

我想要的是一个集中区域来捕获和记录这些虚拟机上出现的任何错误。

我正在考虑创建一个新数据库并设置一个 WCF 服务,以使每个 Web 应用程序能够在我的集中式数据库以及本地 EventLog 中创建日志条目。

这是一个糟糕的设计吗?

更新

Web应用程序位于2003/IIS6和2008/IIS7上,内置于ASP.NET中。许多实例位于一对 Web 服务器上,但许多实例将部署到单独的虚拟机上。

I have a bunch of existing client/server applications that are currently chugging along. Once in a while, a client will want to add on some type of web-interface to access part of their data. These are typically custom, although some are "generic"; but everyone has their own "instance" in its own VM.

What I want is a centralized area to capture and log any errors that come up on any of these VMs.

I'm consitering creating a new database and setting up a WCF Service to enable each of these webapps to create a log entry in my centralized database as well as to the local EventLog.

Is that a bad design?

update

The webapps are on 2003/IIS6 and 2008/IIS7, built in ASP.NET. Many of the instances are on a pair of web servers, but many will be deployed to individual VMs.

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

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

发布评论

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

评论(3

帅哥哥的热头脑 2024-08-23 18:17:58

这正是我们的实施方式。

我们的数据库中有 3 个表:

Event Types
------------ 
EventType int 
EventDescription varchar(50)


MonitoredSystems
---------------
SystemID int
SystemName varchar(50)
SystemDescription text


Events
-------
RecordID bigint
EventTime datetime
SystemID int FK
EventText text
EventType int FK
Acknowledged bit

我们还创建了一个可以查看事件的网站。 “已确认”字段让我们可以设置一个名为“未确认的关键问题”的视图,以便我们可以快速查看任何新问题,并在阅读时确认它们。

我们知道还有其他工具可以为我们做到这一点,但没有一个工具像我们自己开发的版本那样容易集成,现在我们在构建的每个应用程序中都使用它。我们还有一些其他自定义功能,我在这里没有提及,其他工具没有提供开箱即用的功能。

所以我觉得你的想法很好。如果您自己构建它,则可以自定义它以按照您想要的方式工作。不过,我建议至少研究一下 Log4net 等工具。

This is exactly how we implemented it.

We have 3 tables in the database:

Event Types
------------ 
EventType int 
EventDescription varchar(50)


MonitoredSystems
---------------
SystemID int
SystemName varchar(50)
SystemDescription text


Events
-------
RecordID bigint
EventTime datetime
SystemID int FK
EventText text
EventType int FK
Acknowledged bit

We also whipped up a site where we could view the events. The "Acknowledged" field let us set up a view names "Unacknowledged critical issues" so that we can quickly see any new issues, and acknowledge them as we read them.

We know there are other tools out there that can do this for us, but none was as easy to integrate as our own home grown version, and we now use it in every app we build. We have some other customizations that I am not mentioning here that other tools didn't provide out of the box.

So I think your idea is fine. If you build it yourself, you can customize it to work the way you want. However, I would recommend at least looking into tools such as Log4net, etc.

猫九 2024-08-23 18:17:58

您应该查看 ELMAH(错误日志记录模块和处理程序)(http://code.google。 com/p/elmah/)与 Orbit One 的异常报告器 (http://aspexceptionreporter.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35343) 组合使用后,可以为您提供企业范围内的集中错误报告覆盖范围。

You should take a look at ELMAH (error logging modules and handlers) (http://code.google.com/p/elmah/) with the combination of Orbit One's Exception Reporter (http://aspexceptionreporter.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35343) which when combined can give you enterprise wide coverage for error reporting in a centralized location.

夜吻♂芭芘 2024-08-23 18:17:58

如果您频繁记录(调试/信息/警告),请确保 RPC 调用是异步完成的。

我建议使用更灵活的数据结构;

Events
-------
RecordID bigint
EventTime datetime
EventLevel text 
SystemID text
EventText text
EventType text
Acknowledged bit

EventProperties
-------
RecordID bigint
key text
value text

EventProperties 允许日志记录应用程序记录任何可能有用的信息,而无需提前定义此类属性。请注意,SystemID 没有任何限制,无需配置即可添加系统。

If you log frequently (debug/info/warning), make sure that you RPC-invokations are done asynchronously.

I'd recommend a more flexible data structure;

Events
-------
RecordID bigint
EventTime datetime
EventLevel text 
SystemID text
EventText text
EventType text
Acknowledged bit

EventProperties
-------
RecordID bigint
key text
value text

The EventProperties allows the logging application to log any information that might be useful, without having to define such properties ahead of time. Note that there are no constraints on SystemID, which allows the addition of systems without configuration.

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