logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: XMLConfigurator, Asp.Net
Date Thu, 21 Jul 2005 19:19:56 GMT
The ASP.NET worker process will restart a web application if the
Web.config file is changed. This may be happening in this case. Don't
store the log4net configuration in the Web.config. Don't use the .config
file extension for the log4net config file. This should stop ASP.NET
restarting on edit. It is worth noting that the ASP.NET worker process
will restart your app for many reasons (e.g. the app is idle for more
than a specified time or uses too much memory) and in .net 1.0 & 1.1 it
is not possible for you to control this behaviour.

If you are editing the log4net config file do you want this
configuration to be reloaded? If so you need to use the
ConfigureAndWatch() method instead of Configure().

Nicko

> -----Original Message-----
> From: Raymond Chan - Symmetrics [mailto:RaymondC@symmetrics.net] 
> Sent: 20 July 2005 22:37
> To: log4net-user@logging.apache.org
> Subject: XMLConfigurator, Asp.Net
> 
> Hello,
> 
>  
> 
> I have an ASP.Net application.
> 
> I initialize log4net in Global.asax using
> 
> log4net.Config.XmlConfigurator.Configure(myConfigFileInfo);
> 
>  
> 
> Can someone explain to me what is suppose to happen when I 
> change the config file?
> 
>  
> 
> It seems that the running asp.net (the app domain?) thread is 
> aborted and Global.asax Application_Start method is called 
> again. This causes me some problems because I actually spawn 
> a new thread in Global.asax (I know, this isn't the greatest 
> design...) to do some background work, and when the config file 
> changes, my threads are aborted.
> 
>  
> 
> When I step through the code in the IDE, I can see in the 
> output window the following:
> 
> An unhandled exception of type 
> 'System.Threading.ThreadAbortException' occurred in Unknown Module.
> 
> Additional information: Thread was being aborted.
> 
> The program '[1376] aspnet_wp.exe: 
> /LM/W3SVC/1/Root/DevMercury-9-127663932072093560' has exited 
> with code 0 (0x0).
> 
>  
> 
> Is this correct? Have I done something wrong? Any thoughts 
> would be greatly appreciated,
> 
>  
> 
> Thank you,
> 
> Raymond
> 
> 

Mime
View raw message