在ASP.NET Web应用程序上审核和记录,所有或选择性的用户输入。你好吗?

时间:2022-04-27 10:35:50

I'm building UI logging into a long-existing ASP.NET enterprise application. I have my own ideas of how to progress from here and am continuing to research & design. But I'd love to hear some details from the SO community.

我正在将UI日志记录到一个长期存在的ASP.NET企业应用程序中。我有自己的想法,如何从这里进步,并继续研究和设计。但我很想听到SO社区的一些细节。

Here are the details, assumptions and questions as of right now, subject to evolve within the enterprise as well as whatever input comes in here on SO:

以下是目前的详细信息,假设和问题,可以在企业内部发展以及SO上的任何输入:

  • Would prefer to have a consistent DB connection since there will be a lot of activity

    宁愿拥有一致的数据库连接,因为会有很多活动

  • Will probably use the ThreadPool, but will this conflict too much with ASP.NET vying for threads?

    可能会使用ThreadPool,但是这会与ASP.NET竞争线程冲突吗?

  • Possibly use in-memory queue (Queue) for logging batches of inputs periodically? (one per domain)

    可能会使用内存中队列(队列)定期记录批量输入? (每个域一个)

  • Will need to be configurable. IE: Could log all page events during their normal postback calls, or hook individual control actions or events to being logged whether there's a postback or not. IE: User collapses a panel.

    需要是可配置的。 IE:可以在正常的回发呼叫期间记录所有页面事件,或挂钩单个控制操作或事件以记录是否有回发。 IE:用户折叠面板。

  • All "high-visibility" UI events that'll already be posting back as well as other events that won't necessarilly post back right away. Have a client batch of events and send occasionally?

    所有“高可见性”UI事件已经发布回来以及其他不必立即发回的事件。有一批客户端偶尔会发送一些事件吗?

  • How do we minimize the impact on existing code?

    我们如何最小化对现有代码的影响?

  • Have "fly on the wall" AJAX functionality that posts back accordingly? It'll basically be watching all that's been configured to be logged.

    有“飞在墙上”的AJAX功能,相应回发?它基本上是在观察所有被配置为记录的内容。

  • Logging must be ordered for reporting a user's step-by-step progress from point A to B in a workflow.

    必须订购日志记录,以报告用户在工作流程中从A点到B点的逐步进度。

2 个解决方案

#1


How about a WCF service that does the actual logging, paired with a PostSharp attribute. In your PostSharp attribute you can call asynchronously to you WCF service while your application hums along. I've implemented something like this in past projects and it works great with little if no slowing down.

如何进行实际日志记录的WCF服务与PostSharp属性配对。在PostSharp属性中,您可以在应用程序嗡嗡作响时异步调用WCF服务。我在过去的项目中实现了类似的功能,如果没有减速的话,效果很好。

http://www.postsharp.org/

#2


Why not use log4net? You could capture a userid, sessionid, and any additional information you need to track step-by-step progress. You could configure the levels so that you could reduce the logging if it impacted performance. I wouldn't consider re-inventing the wheel by writing your own framework when there are several viable existing logging frameworks.

为什么不使用log4net?您可以捕获用户ID,会话ID以及跟踪逐步进度所需的任何其他信息。您可以配置级别,以便在影响性能时减少日志记录。当有几个可行的现有日志框架时,我不会考虑通过编写自己的框架来重新发明*。

#1


How about a WCF service that does the actual logging, paired with a PostSharp attribute. In your PostSharp attribute you can call asynchronously to you WCF service while your application hums along. I've implemented something like this in past projects and it works great with little if no slowing down.

如何进行实际日志记录的WCF服务与PostSharp属性配对。在PostSharp属性中,您可以在应用程序嗡嗡作响时异步调用WCF服务。我在过去的项目中实现了类似的功能,如果没有减速的话,效果很好。

http://www.postsharp.org/

#2


Why not use log4net? You could capture a userid, sessionid, and any additional information you need to track step-by-step progress. You could configure the levels so that you could reduce the logging if it impacted performance. I wouldn't consider re-inventing the wheel by writing your own framework when there are several viable existing logging frameworks.

为什么不使用log4net?您可以捕获用户ID,会话ID以及跟踪逐步进度所需的任何其他信息。您可以配置级别,以便在影响性能时减少日志记录。当有几个可行的现有日志框架时,我不会考虑通过编写自己的框架来重新发明*。