简体   繁体   English

客户端日志记录策略

[英]Client-side logging strategy

I need to implement a logging strategy for a WPF application that will run on the Desktop of client side of the application. 我需要为WPF应用程序实施一个日志记录策略,该策略将在该应用程序的客户端桌面上运行。

I am using the Enterprise Library Caching Block (v5) and there is a lot of great functionality. 我正在使用企业库缓存块(v5),并且有很多强大的功能。 However, I do not want to reveal too much information about how the business logic does its's thing. 但是,我不想透露太多有关业务逻辑如何做事情的信息。 This sorta conflicts with an easy-to consume log messages. 这种排序与易于使用的日志消息冲突。 One the one hand I need to log as much information as possible to provide debugging support. 一方面,我需要记录尽可能多的信息以提供调试支持。 One the other hand I don't want to reveal too much information that may enable reverse-engineering by reading the log files. 另一方面,我不想透露太多可能通过读取日志文件来启用逆向工程的信息。

I initially had thought of hashing class names and assigning an int identifier to each method and then logging that information on the client-side. 最初,我曾想过对类名称进行哈希处理,然后为每个方法分配一个int标识符,然后将该信息记录在客户端。 This would reduce the amount of information that can be used for unintended purposes, but is not very efficient when I have to read the files and transpose the hashed ids back to the class names. 这将减少可用于非预期目的的信息量,但是当我不得不读取文件并将散列的ID转置回类名时,效率不是很高。

Anyone have experience with this issue, any good articles on this? 任何人都对此问题有经验,对此有好的文章吗?

Thanks. 谢谢。

If this log is intended to be only enabled when errors or issues occurs and for yourself to read then I wouldn't bother by trying to obfuscate the log to hide "business logic" from users. 如果打算仅在发生错误或问题时启用此日志,并且供您自己阅读,那么我不会为使日志模糊而对用户隐藏“业务逻辑”而烦恼。

The obfuscation will only slow down you debugging of the issue, and as you surmise, if someone really wants to look at your business logic, they can just get a disassembler. 混淆只会减慢您调试问题的速度,并且在您推测时,如果某人真的想查看您的业务逻辑,他们可以得到反汇编程序。

I think you'll find most users don't even bother looking at anything *.log . 我认为您会发现大多数用户甚至都不会理会*.log

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM