|
RE: Logging in a Web App (Threads, Sessions and Requests): msg#00038log.log4net.user
Yeah, you're totally right. As I sat at lunch I realized it was a dumb question. Since this is by request, each request is on a thread and a thread can only do 1 thing at a time so request 1 HAS to finish before request 2 (assuming they are on the same thread). Thanks so much for your patience and your help! -----Original Message----- From: Ron Grabowski [mailto:rongrabowski@xxxxxxxxx] Sent: Thursday, February 10, 2005 12:04 PM To: Log4NET User Subject: RE: Logging in a Web App (Threads, Sessions and Requests) I think you're getting confused with HttpHandlers. There is a member of the IHttpHandler interface called IsResulable which says: " Gets a value indicating whether another request can use the System.Web.IHttpHandler instance. " I believe that each request gets its own HttpModule. That's why HttpApplication is passed into the Init function. Every request has its own context. If I put something into request1's context, I don't have access to that item from request2. --- "Hart, Leo" <Leo.Hart@xxxxxxx> wrote: > Oh, I get it now! The "MyAuthenticateRequest" name woke me up. > Thanks! > > A question: what happens in the following situation: > > There are two requests on the same thread. > > Request1 starts > log4net.MDC.Set("sessionID", mContext.Session().SessionID) is called > in my HttpModule > Some logging for Request1 occurs > Request2 starts > log4net.MDC.Set("sessionID", mContext.Session().SessionID) is called > in my HttpModule > Some logging for Request2 occurs > Some logging for Request1 occurs > Request1 ends > Request2 ends > > Once that second MDC.Set is called, won't all of my logging for > Request1 be written with Request2's sessionID? Since a web app is > multi-threaded, I cannot guarantee that Request1 will finish before > Request2 application, can I? |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Logging in a Web App (Threads, Sessions and Requests): 00038, Ron Grabowski |
|---|---|
| Next by Date: | Solution for problem using Rolling FileAppender: 00038, Sridhar S |
| Previous by Thread: | RE: Logging in a Web App (Threads, Sessions and Requests)i: 00038, Ron Grabowski |
| Next by Thread: | RE: Logging in a Web App (Threads, Sessions and Requests): 00038, Nicko Cadell |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |