I have fields in my almost all tables like createdBy or updatedBy.
I think that’s just for reference.
Do you think I should enter username there or userID. Because if i need to look at database directly then that can give better understanding or it’s a bad practice.
always use foreign keys to store referential records, that is userID in your case.
and regarding the approach on how to store, it depends on what you need.
it is always good to store foreign keys instead of other records, because this way you can relate and fetch all the records of a user. this approach will have a limitation though, since you can store only one userID, you can only know who last updated it.
user_log with columns user_id, update_datetimeand perhaps a message column, telling what did the user do.