logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Fiala" <dfi...@celadonlabs.com>
Subject RE: Question about ConfigurationResetEvent
Date Thu, 25 Oct 2007 19:09:15 GMT
No need to piggyback on to log4net for this, you can use the
FileSystemWatcher class directly, which is yours free with the .NET
Framework....
 
http://msdn2.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx
 
 
Regards,
 
Dean
 

  _____  

From: dawebber [mailto:dawebber1@gmail.com] 
Sent: Thursday, October 25, 2007 1:57 PM
To: log4net-user@logging.apache.org
Subject: Question about ConfigurationResetEvent



Hello, all!

I would like to make use of (and piggyback on) log4net's ability to watch
the app config file for changes. I have a Windows Service, which I would
like to have the ability to reread configuration on the fly, after I edit
the configuration file. 

 

I use the following to init the logger:

log4net.ILog _logger =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()
.DeclaringType);

 

I can see in the debug output that ConfigurationResetEvent fires when I
change the file. So, that works well.

 

But, when I try to do this:

 

_logger.Logger.Repository.ConfigurationResetEvent +=new
log4net.Repository.LoggerRepositoryConfigurationResetEventHandler(Logger_Con
figurationResetEvent);

 

My event handler doesn't fire when the config file changes.

 

Do you guys have any suggestions for me on this?

 

Thank you in advance.

 

Regards,

Mark Gimelfarb. 

Mime
View raw message