客户端日志记录策略

发布于 2025-01-01 14:26:27 字数 350 浏览 0 评论 0原文

我需要为将在应用程序客户端桌面上运行的 WPF 应用程序实施日志记录策略。

我正在使用 Enterprise Library Caching Block (v5),它有很多很棒的功能。但是,我不想透露太多有关业务逻辑如何完成其​​工作的信息。这与易于使用的日志消息有点冲突。一方面,我需要记录尽可能多的信息以提供调试支持。另一方面,我不想透露太多可能通过读取日志文件进行逆向工程的信息。

我最初想到的是散列类名并为每个方法分配一个 int 标识符,然后在客户端记录该信息。这会减少可用于非预期目的的信息量,但当我必须读取文件并将散列 ID 转回类名时,效率不是很高。

任何人都对这个问题有经验,有这方面的好文章吗?

谢谢。

I need to implement a logging strategy for a WPF application that will run on the Desktop of client side of the application.

I am using the Enterprise Library Caching Block (v5) and there is a lot of great functionality. 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. 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.

Anyone have experience with this issue, any good articles on this?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法少女 2025-01-08 14:26:27

如果此日志仅在发生错误或问题时启用并供您自己阅读,那么我不会试图混淆日志以向用户隐藏“业务逻辑”。

混淆只会减慢您对问题的调试速度,并且正如您猜测的那样,如果有人真的想查看您的业务逻辑,他们只需使用反汇编程序即可。

我想您会发现大多数用户甚至懒得查看任何*.log

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文