Silverlight日志记录框架和/或最佳实践 [英] Silverlight Logging framework and/or best practices

查看:94
本文介绍了Silverlight日志记录框架和/或最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,Silverlight 2终于发货了.我想知道是否有人为它建立了任何日志记录框架,也许像 enterprise库日志记录还是 log4net ?我对可以执行客户端跟踪并将消息记录到服务器的事情很感兴趣.

Now that Silverlight 2 has finally shipped. I'm wondering if anyone has put together any logging frameworks for it, maybe something like enterprise library logging or log4net? I'm interesting in something that can perform tracing client side and also log messages to the server.

到目前为止,我找到的唯一项目是 Clog .codeproject.com/KB/silverlight/SilverlightLogging.aspx"rel =" noreferrer> CodeProject .有人用过吗?您对此有何看法?

So far the only project I have found is Clog on CodeProject. Has anyone used this? What were your thoughts on it?

推荐答案

对于我们编写的产品,我将自己研究类似的内容.我正在考虑使用PostSharp for Silverlight将客户端日志记录添加为一个方面.

I am about to delve into something similar myself for a product we've written. I'm considering using PostSharp for Silverlight to add client-side logging as an aspect.

在完整的.NET Framework和Compact Framework之前,我已经成功地使用了NLog项目,因此我很可能会采用现有的框架代码并添加一些日志记录目标:

I have used the NLog project with great success before under the full .NET Framework and the Compact Framework so I'll most likely take the existing framework code and add some logging targets:

  • 一个标准的System.Diagnostics目标,可以使用DebugView等进行捕获.
  • 与NLog中的目标类似的异步Web服务目标.
  • 隔离的存储目标,具有向服务器语义的延迟传输.

我简要看过Clog,它似乎有一个主要缺陷-它无法记录连接失败.因此,假设您的Web服务器一直在线,则可以正常工作,但是当上游或服务器本身出现问题时,日志记录数据将全部丢失,甚至可能使您的应用程序崩溃.

I've briefly looked at Clog and it seems to suffer from one major flaw - it can't log a connection failure. So assuming your Web server is online all the time, yes it will work, but when problems occur upstream or on the server itself, the logging data is all lost and might even crash your application.

这篇关于Silverlight日志记录框架和/或最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆