deepstreamIO / deepstream.io

deepstream.io server
https://deepstreamio.github.io
MIT License
7.13k stars 382 forks source link

Best way to log users activity #1102

Closed caracal7 closed 3 years ago

caracal7 commented 3 years ago

Witch the best way to log users activity?

I need log to database:

  1. User logged in
  2. User goes online
  3. User goes offline
  4. User make RPC call
  5. User logged out

My decision: 1 and 5: in message broker AuthenticationHandler isValidUser() 2 and 3: in microservice(node client) with using Presence API 4: in every RPC procedure or in message broker PermissionHandler canPerformAction()

Is it right way?

jaime-ez commented 3 years ago

Take a look at the monitoring plugin, by filtering the message types you can log any message https://deepstream.io/tutorials/custom-plugins/monitoring/