Databases: Making a Log of actions, how to handle various references?

后端 未结 4 1063
离开以前
离开以前 2021-02-06 11:44

hope you all had a happy new year.

So, my question is, what\'s the best way to make a log of actions. Let me explain it with a example, suppose we have these entities:

4条回答
  •  别那么骄傲
    2021-02-06 12:36

    Do you need this for logging/tracking purposes, or for display to users and admin? If your use for logging/tracking (i.e. computer readable), you should probably separate your logging into multiple tables like you specified.

    However, if you want this for your users or display on screen, why not just store it in basic html? This way you can easily display it on screen and view.

    For example, "User A (link to user), B (link to user) and C (link to user) played a game (link to game)" would be

    User A
    , User B
    , and User C
    played a game of Chess.
    

提交回复
热议问题