Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Adding Monitoring(/Logging?) feature

What would be a good starting point to add a monitoring or logging feature? Things like viewing current online/active users, logins and so on?

Would you just take the data from the DB? (And for example for the current online users feature use the users table to determine if a user is online by adding a last_login and last_logout columns and query active users if login > logout?), or there are other ways to do it?

0 likes
7 replies
Ligonsker's avatar

@Sinnbeck Oh you're right. For this thing there's no escape from Websockets. I actually made my own soketi server in the past. Who knew it might come handy :D

And for other features such as logins and logouts? I remember in my previous workplace we used a special package that was used to detect changes on models. I just can't remember the name, maybe you know what I'm talking about.. or you have another suggestion?

Ligonsker's avatar

@Sinnbeck Could be, looks similar. Not sure if exactly that, will try to look further and if not I guess it's really that (From some reason I have other name on the tip of my tongue)

Ligonsker's avatar

@Snapey yes! This is it !!! Which one would be better for logging information? This or spatie activity log as suggested by @sinnbeck ? Or do something else/ myself?

Sinnbeck's avatar

@Ligonsker I would personally see if they can do all I need. And if they are well maintained

But I'm still curious of how you plan to log logout? I haven't clicked a logout button in years :)

1 like

Please or to participate in this conversation.