Dynamic logging path

we are sending request from different user and we want to change log path as per the user name.

lets say there are two user A and B. and we have define log path(in yaml file) “/tmp/loki” if user A request than logs should store to “/tmp/loki/A” and for B “/tmp/loki/B”.

is there any way we can define dynamic path for log? this user is not fix number it could N number.