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

查看:27
本文介绍了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:

  • 使用 DebugView 等启用捕获的标准 System.Diagnostics 目标.
  • 一个类似于 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天全站免登陆