I am trying to write log file per user separately
For this I am setting the property of file name as a current user id and configuring log4net like this
log4net.GlobalContext.Properties["userid"] = userId;
log4net.Config.XmlConfigurator.Configure();
This is all working good, it creates new log file per user and logs all the activities by the user in their separate files.
Problem starts when multiple users request service simultaneously, it then starts putting part of logs of one user to another users file, so all logs get mixed up in the simultaneous users files.
I am getting the reason that global settings are getting overridden by user2 while user1 is in progress so user1 starts writing logs to user2's file as the settings are now overridden.
I tried log4net.LogicalThreadContext
and log4net.ThreadContext
also but they also didn't work.
Is there any workaround for this?