Hi,
I am not using the Web.Config file. I have my own (.ini) file where I
store my own application configuration items, including the log4net.

I have changed the call to XmlConfigurator.Configure to
XmlConfigurator.ConfigureAndWatch.

When I change my .ini file, the web application is restarted. 
Is log4net doing this? Or do you think it is something in our
application that is causing it?

Thanks,
Raymond


-----Original Message-----
From: Nicko Cadell [mailto:[EMAIL PROTECTED] 
Sent: July 21, 2005 12:20 PM
To: Log4NET User
Subject: RE: XMLConfigurator, Asp.Net

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:[EMAIL PROTECTED] 
> Sent: 20 July 2005 22:37
> To: [email protected]
> 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
> 
> 

Reply via email to