Check out the Audit Trail module (https://marketplace.mendix.com/link/component/138).
This module has functionality for this.
We have one entity and we are also storing system attributes in that entity (owner, createdDate, changedBy etc.) ,
Now I want to log this changedBy attribute every time I commit my object.
It is working with other objects, but this changedBy attribute is always empty though the data is available. Can someone help me whether we need to follow any recommendations here.