Database Logging

I’m thinking about to implement some basic Logging / History feature in my MySQL Database. But now sure how to do it. Maybe you have some ideas how to do that.

What I mean is that if some user is logging into his profile, I want to catch that information into some special table like t_logs and there put infos like what kinda “action / step” it was. Like “userid, timestamp, action”. So I can handle informations about users activity, users posts, changes etc. If I want to catch user id’s okay. Thats fine with my example above. But what if I want to catch also image storings, changes and maybe postings. So that information doesnt directly belongs to his user. So I would need to expand my t_log from

"userid, timestamp, action".

to

userid, postid, imageid, timestamp, action"

Or maybe I can go with already implemented database tools… I guess there would be some. As in DB that stuff is logged already… So maybe there’s a way NOT TO CREATE THAT WHOLE LOGGING FROM SCRATCH ? Thanx !

Community Page
Last updated: