简体   繁体   English

如何使用PHP创建审计跟踪/活动日志

[英]How to make an Audit Trail / Activity Log using PHP

Is there a template already out there for PHP/MySQL that tracks the activity of a user? 是否有用于跟踪用户活动的PHP / MySQL的模板? I already have audit trail but it only gets the time of logged in/log out. 我已经有审计跟踪但它只获得登录/注销的时间。 Not the changes or activity he did on his/her login. 不是他在登录时所做的更改或活动。

The best logging framework for php is log4php , since its from Apache itself. php的最佳日志框架是log4php ,因为它来自Apache本身。 log4php has flexibility to choose the log storage (mysaql, text file or email) log4php可以灵活地选择日志存储(mysaql,文本文件或电子邮件)

However the basic idea of user activity tracking is this: 但是,用户活动跟踪的基本思想是:

  1. Define the 'actions' performed by your website users, in a database table (action) 在数据库表(操作)中定义网站用户执行的“操作”
  2. Map actions performed by the users using one relational table (user_action) 使用一个关系表(user_action)映射用户执行的操作

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

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