0

i want to log every visitor's behavior

  1. authenticated user or guest
  2. visiting ip
  3. time
  4. sequence of the requests
  5. database read/write (if any)
  6. log out time (for authenticated user) , or session over time (for guest)

how do i achieve that?

thank you very much.

1 Answers1

0

There are readily available extensions for this I have used this extension for most of your use cases

http://www.yiiframework.com/extension/audittrail/

or the newer version is here

http://www.yiiframework.com/extension/audittrail2/

For 2. you would need to create some client side code js as well,

For 6. Writes can be captured by auditTrail, generally DB reads i don't advise capturing, as it generates a lot of data and causes significant overhead.

Manquer
  • 7,390
  • 8
  • 42
  • 69