Here's our situation...

We're adding debug messages to an ASP.Net web application that allows our users 
to apply for a job online.  We have a custom properties and database fields 
created named JobPostingId and MemberId.  Here's a small code snippet of our 
logging.

ILog logger = LogManager.GetLogger(CONST_JOBPOSTINGS);

if (logger.IsDebugEnabled)
{
                log4net.ThreadContext.Properties[CONST_JOBPOSTINGID] = 
JobPostingId;
log4net.ThreadContext.Properties[CONST_MEMBERID] = MemberId;
                logger.Debug(message);
}

We've noticed very inconsistent values for our custom properties.  I suspect it 
has something to do with the context belonging to a thread and that same thread 
being reused by different web requests, therefore different users.

Does anyone have suggestions for me on how I can capture user specific data 
into custom properties?  Any thoughts or suggestions would be greatly 
appreciated.

Reply via email to