Scenario: A asp.net web application was deployed on remote IIS and is configured to log into oracle database.Log table has these columns:Login_ID,Log_message,Querystring,ipaddress. So the deployed url was browsed from different systems using different login_ids
Problem: When the application is runned on different systems with different login Ids and different flows, login id of one flow/system is getting inserted for another flow/system. But when a single instance of the application is runned, walues are properly inserted.
Example: With login id X, the site is browsed through a flow ‘A’ and another user with loginid Y is browsing the site through flow ‘B’ . Loginid ‘ X’ is getting inserted into records with flow ‘B’ and flow ‘A’
Code:
user = (User)Session["User"];
log4net.GlobalContext.Properties["LOGIN_ID"] = user.loginid;
Research: After going through few sites, I learnt that log4net contexts doesn’t function properly with asp.net.
http://piers7.blogspot.com/2005/12/log4net-context-problems-with-aspnet.html
http://piers7.blogspot.com/2007/07/log4net-in-aspnet-redux-implement.html
These links suggest me to use httpcontext, which i tried but unable to get the result. So can anyone help me to solwe this problem.