有没有办法让 Log4net 在 Windows Phone 7 上工作?
我是 Apache Log4Net 的忠实粉丝,并且一直在使用它。我对将这种日志记录功能引入 Windows Phone 7 感到不知所措。
您/您能做到这一点吗?
如何?
I'm a huge fan of the Apache Log4Net, and have been using it forever. I'm at a loss bringing this logging power to Windows Phone 7.
Have you / Can you accomplish this?
How?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果有 Log4Net 的 Silverlight 版本,那么它应该能够在 Windows Phone 7 上工作。您必须记住,鉴于底层环境是 Silverlight,Windows Phone 7 上的 100% 网络 I/O 将是异步的,因此,除非使用 Begin/End Response 方法,否则任何记录到远程服务器的标准调用都将不起作用。
If there's a Silverlight version of Log4Net then that should be able to work on Windows Phone 7. You have to keep in mind that 100% of your network I/O off of Windows Phone 7 will be asynchronous given that the underlying environment is Silverlight, so any of the standard calls for logging to a remote server won't work unless they use the Begin/End Response methods.
这是最近发布的,您可能想将其作为起点。
Silverlight 和 WP7 异常处理和日志记录构建块
This was released recently that you might like to check out as a starting point.
Silverlight and WP7 Exception Handling and Logging building block
这对于 Silverlight 分析框架 (http://msaf.codeplex.com/) 来说可能是一个很好的用途。
这只是一个猜测,因为我今晚开始将 MSAF 放入应用程序中。我知道您可以在 Google Analytics 中记录自定义条目(尽管我忘记了正确的术语),并希望 MSAF 也提供该功能。
This may be a good use for the Silverlight Analytics Framework (http://msaf.codeplex.com/).
Just a guess at this point since I'm starting to put MSAF in an app tonight. I know you can log custom entries in Google Analytics (although I forget the proper term) and hoping MSAF provides that functionality as well.
这对 log4net 没有帮助,但是你考虑过 NLog 吗? NLog 2.0 已推出测试版并且与 Silverlight 兼容。
http://nlog-project.org/
NLog 2.0 还支持异步日志记录。
我没有做过任何WP7开发,所以我真的不知道在该环境下登录还有什么其他注意事项。
更新:NLog 最近宣布推出 Windows Phone 测试版7.
祝你好运。
This doesn't help with log4net, but have you considered NLog? NLog 2.0 is out in beta and is compatible with Silverlight.
http://nlog-project.org/
NLog 2.0 also supports asynchronous logging.
I have not done any WP7 development, so I don't really know what other considerations there are for logging in that environment.
Update: NLog recently announced a beta release for Windows Phone 7.
Good luck.