用户日志记录:应保留哪些数据?
背景:工作用户登录的用户问答网站等。应保留哪些用户/访客数据?
- IP地址
- 日期/时间
- 等
Background: working a user q&a site where users logged,etc. What user/visitor data should be retained?
- ip address
- date/time
- etc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我同意 @Franci 的回复。收集数据是为了回答你也需要答案的问题,而不是收集数据来提出你恰好能够回答的问题。
一般来说,有时值得记录以下信息:
但是!如果您打算执行所有这些操作,不妨使用 Google Analytics ;)
I agree with @Franci's response. Collect data to answer questions that you need answers too, don't collect data to ask questions that you just so happen to be able to answer.
In general, it is sometimes worth while to log the following:
But! If you're going to do all that, you might as well use Google Analytics ;)
为了收集数据而收集数据是一个坏习惯。我建议从另一端开始 - 弄清楚您想要回答的问题是什么,这将为您提供需要收集的数据。
Collecting data for the sake of data collection is a bad habit. I would suggest to start from the other end - figure out what are the questions you want to answer and that would give you the data you need to collect.
这取决于你在做什么。我为一家大公司运营一个内部网站,我们在这里记录用户(公司员工)的每次点击。
但当然,我们的员工在使用公司内部应用程序时并不期望隐私。公共网站有责任保护其用户的数据,而最好的方法就是从一开始就不要收集这些数据。
我建议您随时收集汇总统计数据。例如,记录有多少用户登录、有多少用户点击了哪个链接等...但不要存储单个用户日志 - 用户 A 点击了 B 等。或者,如果您想获得调试信息,仅在有限的时间内存储它。如果用户单击按钮 24 小时后,您还没有收到错误报告,则您可能不再需要该数据。
it depends on what you're doing. i run an internal website for a large company, and here we log every click our users (employees of the company) make.
but of course, our employees have no expectation of privacy when using internal company applications. a public website has a responsibility to protect their user's data, and the best way to do that is not to collect it in the first place.
I would suggest collecting aggregate stats as you go. For instance, keep counters on how many users logged in, how many clicked on what link, etc... But don't store individual user logs - User A clicked on B, etc. Or, if you want to have debugging info, store it only for a limited time. If 24 hours after a user clicked a button, you haven't gotten an error report, you probably don't need that data anymore.
仅存储您绝对需要存储的内容。假设您存储的有关客户的任何数据都可能被窃取,并且某个地方的某人会找到恶意使用该信息的方法。然后问问自己你真正需要什么。
但话又说回来,我就是这样偏执。
Store only what you absolutely need to store. Assume that any data you store about your customers can be stolen and that someone, somewhere will find a way to use that information maliciously. Then ask yourself what you really need.
But then again, I'm paranoid that way.