Re: log4net Contexts and ASP.NET

2006-02-19 Thread Ron Grabowski
If there's a global isWeb setting, you wouldn't be able to easily tell certain loggers (i.e. a certain namespaces) to use CallContext. What about setting the LogicalThreadContext's storage at the logger level? root level value=ALL / appender-ref ref=FileAppender /

Re: log4net Contexts and ASP.NET

2006-02-16 Thread Aaron Morton
Josh, I've been doing something similar with remoting Contexts. I'm putting some objects into a new Context, and using ContextProperties to inject message sinks which intercept some calls and add information to the Context Property. In this case i'm not using the ThreadLogicalContext as i

Re: log4net Contexts and ASP.NET

2006-02-16 Thread josh robb
Ron Grabowski [EMAIL PROTECTED] wrote: I don't think HttpContext is always available...especially inside the Global.asax.cs methods and/or inside CacheItemRemovedCallback methods. HttpContext is available during the life cycle of a Http request. This includes any event handler in Global.asax

Re: log4net Contexts and ASP.NET

2006-02-16 Thread GlennDoten
On 2/16/06, josh robb [EMAIL PROTECTED] wrote: Conceptually - this is what I'm proposing:if(isWeb and HttpContent.Current != null){ // store context in HttpContext.Current.Items} else { // sore it in CallContext.} Josh, why bother with a flag called isWeb? If HttpContext.Current is not null then

log4net Contexts and ASP.NET

2006-02-15 Thread josh robb
I've seen an email from Piers Williams in december asking about this. Basically - in an ASP.NET application - none of the existing contexts are safe to use. I'd like to remedy this. There are two ways forward that I can see. 1. Add a new WebContext class. 2. Change the ThreadLogicalContext

Re: log4net Contexts and ASP.NET

2006-02-15 Thread josh robb
Yep - Thats the email I was talking about. Thanks for the reply. j.

Re: log4net Contexts and ASP.NET

2006-02-15 Thread Chad Humphries
Sorry, I blanked and completely glazed over the first line of your email. :) -Chad On 2/15/06, josh robb [EMAIL PROTECTED] wrote: Yep - Thats the email I was talking about. Thanks for the reply. j.

Re: log4net Contexts and ASP.NET

2006-02-15 Thread Ron Grabowski
I don't think HttpContext is always available...especially inside the Global.asax.cs methods and/or inside CacheItemRemovedCallback methods. According to this article: http://www.odetocode.com/Articles/112.aspx HttpContext is just a wrapper around System.Runtime.Remoting.Messaging.CallContext.