客户端中的异常处理 - 服务器体系结构

时间:2021-05-29 21:09:22

I have a project consisting of a windows client (approx. 150 users), a webservice and some windows services. All together working in an intranet and build using C# .NET 3.5. Now I want to log exceptions in a central database and manage them (watch top 10, ticket system, etc.) via a web application.

我有一个由Windows客户端(大约150个用户),Web服务和一些Windows服务组成的项目。所有这些都在Intranet中工作并使用C#.NET 3.5构建。现在我想在*数据库中记录异常并通过Web应用程序管理它们(观察前10名,票务系统等)。

I thought about using and expanding ELMAH, because it already has an web application for management. Maybe create a webservice for the clients to log their exceptions.

我想过使用和扩展ELMAH,因为它已经有一个用于管理的Web应用程序。也许为客户创建一个Web服务来记录他们的异常。

Is that a good idea, because ELMAH is obviously intended for asp.net web sites only.

这是一个好主意,因为ELMAH显然只适用于asp.net网站。

I am aware of the Exception Management Application Block, but as far as I know it has no management application like ELMAH, plus my last visit at the Enterprise Library was no fun.

我知道异常管理应用程序块,但据我所知,它没有像ELMAH这样的管理应用程序,而且我上次访问企业库并不好玩。

What is your opinions, are there other ideas?

你有什么看法,还有其他想法吗?

2 个解决方案

#1


Enterprise Library is cumbersome and overkill. Look at open source logging components: NLog link text or Log4Net link text. They both have the capability to log to various "sinks" including a flat file, UDP, database, etc.

企业库既繁琐又过度。查看开源日志记录组件:NLog链接文本或Log4Net链接文本。它们都能够记录到各种“接收器”,包括平面文件,UDP,数据库等。

I would set something up where your logging component writes to the event log on the server. Then use something like Microsoft Operations Manager (MOM) or another systems management software that can scan the event log and raise alerts via paging, command-center console, etc. At the same time, you could also log to a database for querying, etc.

我会设置一些内容,您的日志记录组件会写入服务器上的事件日志。然后使用Microsoft Operations Manager(MOM)或其他系统管理软件,可以扫描事件日志并通过分页,命令中心控制台等发出警报。同时,您还可以登录到数据库进行查询等。 。

If you are looking for management of exceptions, reporting, alerting, etc... There are tons of solutions like MS MOM, Tivoli, CA Unicenter, HP OpenView, and even NagIOS that you could use for this.

如果您正在寻找异常,报告,警报等管理......有许多解决方案,如MS MOM,Tivoli,CA Unicenter,HP OpenView,甚至是NagIOS,您可以使用它们。

The client-side is a bit more tricky. Since it is intranet, you could use UDP and run a service on the server that will listen for those UDP packets and store them in the event log and/or a database. Or you could add some methods to your web service to capture logging events.

客户端有点棘手。由于它是Intranet,您可以使用UDP并在服务器上运行服务,该服务将侦听这些UDP数据包并将它们存储在事件日志和/或数据库中。或者,您可以向Web服务添加一些方法以捕获日志记录事件。

#2


I don't think that your idea to expand ELMAH is a bad one at all. Having done many similar projects I've always had to roll my own management apps and it is always a pain. Not sure how much you will be able to use from ELMAH but it sounds like it might be a great starting place.

我不认为你扩展ELMAH的想法是一个糟糕的想法。做了很多类似的项目后,我总是不得不推出自己的管理应用程序,这总是很痛苦。不知道你能从ELMAH使用多少,但听起来它可能是一个很好的起点。

#1


Enterprise Library is cumbersome and overkill. Look at open source logging components: NLog link text or Log4Net link text. They both have the capability to log to various "sinks" including a flat file, UDP, database, etc.

企业库既繁琐又过度。查看开源日志记录组件:NLog链接文本或Log4Net链接文本。它们都能够记录到各种“接收器”,包括平面文件,UDP,数据库等。

I would set something up where your logging component writes to the event log on the server. Then use something like Microsoft Operations Manager (MOM) or another systems management software that can scan the event log and raise alerts via paging, command-center console, etc. At the same time, you could also log to a database for querying, etc.

我会设置一些内容,您的日志记录组件会写入服务器上的事件日志。然后使用Microsoft Operations Manager(MOM)或其他系统管理软件,可以扫描事件日志并通过分页,命令中心控制台等发出警报。同时,您还可以登录到数据库进行查询等。 。

If you are looking for management of exceptions, reporting, alerting, etc... There are tons of solutions like MS MOM, Tivoli, CA Unicenter, HP OpenView, and even NagIOS that you could use for this.

如果您正在寻找异常,报告,警报等管理......有许多解决方案,如MS MOM,Tivoli,CA Unicenter,HP OpenView,甚至是NagIOS,您可以使用它们。

The client-side is a bit more tricky. Since it is intranet, you could use UDP and run a service on the server that will listen for those UDP packets and store them in the event log and/or a database. Or you could add some methods to your web service to capture logging events.

客户端有点棘手。由于它是Intranet,您可以使用UDP并在服务器上运行服务,该服务将侦听这些UDP数据包并将它们存储在事件日志和/或数据库中。或者,您可以向Web服务添加一些方法以捕获日志记录事件。

#2


I don't think that your idea to expand ELMAH is a bad one at all. Having done many similar projects I've always had to roll my own management apps and it is always a pain. Not sure how much you will be able to use from ELMAH but it sounds like it might be a great starting place.

我不认为你扩展ELMAH的想法是一个糟糕的想法。做了很多类似的项目后,我总是不得不推出自己的管理应用程序,这总是很痛苦。不知道你能从ELMAH使用多少,但听起来它可能是一个很好的起点。