Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 48508 invoked from network); 25 Oct 2007 22:00:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Oct 2007 22:00:43 -0000 Received: (qmail 90073 invoked by uid 500); 25 Oct 2007 22:00:30 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 90044 invoked by uid 500); 25 Oct 2007 22:00:30 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 90033 invoked by uid 99); 25 Oct 2007 22:00:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 15:00:30 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dawebber1@gmail.com designates 209.85.146.181 as permitted sender) Received: from [209.85.146.181] (HELO wa-out-1112.google.com) (209.85.146.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 22:00:34 +0000 Received: by wa-out-1112.google.com with SMTP id v27so843421wah for ; Thu, 25 Oct 2007 15:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=6IhMvGaAbaRQnei5ScuQRo5PEgMinXm0KEusY+R6ftY=; b=ftQUh0nUEQD4/RsR28VnpbmFv0iQWaTszcD02KRfeAe8xEgFfGASrfmzg71TBmD08gSnGXt/BCF6VgkhZnS0/NUUIqd7D+Hrdr4HQ7izT4iB4RCQTMzvag/m/udIC9w7kgdFSDu8j00UvaTaXNq8gYNyWCCW3Fxxktz9NIXz9s4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=fXbO8ho4ywkcYqlHgwy3OdxHjZYc865huCb66+zPOoILPk5sBKt/d7TBrYTW+XNP1Ro7ABKSnTUh7gJ44Ita+yr82NMv3lCyciE17V1/6zCWtoqpdbVct6zCjuqQGirfMh4j3C+1H+elI7OOUhOTWt0033zGwNMT3+0gBBZo5JE= Received: by 10.114.88.1 with SMTP id l1mr430618wab.1193349611808; Thu, 25 Oct 2007 15:00:11 -0700 (PDT) Received: by 10.114.193.12 with HTTP; Thu, 25 Oct 2007 15:00:11 -0700 (PDT) Message-ID: Date: Thu, 25 Oct 2007 17:00:11 -0500 From: dawebber To: "Log4NET User" Subject: Re: Question about ConfigurationResetEvent In-Reply-To: <20071025211057.19C534DA0ED@nike.apache.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4346_21574968.1193349611795" References: <20071025211057.19C534DA0ED@nike.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_4346_21574968.1193349611795 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Dean, Thank you for your suggestion. It's a good one, and I have thought about it, but since L4N is already doing it (running a separate thread with a FSO) I just wanted to reuse what's already there. If I could just hook in to ConfigureationResetEvent that would be great. Should I be asking this question on log4net-dev also? Regards, M.G. On 10/25/07, Dean Fiala wrote: > > 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_ConfigurationResetEvent); > > > > 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. > ------=_Part_4346_21574968.1193349611795 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Dean,
Thank you for your suggestion. It's a good one, and I have thought about it, but since L4N is already doing it (running a separate thread with a FSO) I just wanted to reuse what's already there. If I could just hook in to ConfigureationResetEvent that would be great.
Should I be asking this question on log4net-dev also?

Regards,
M.G.

On 10/25/07, Dean Fiala <dfiala@celadonlabs.com > wrote:
No need to piggyback on to log4net for this, you can use the FileSystemWatcher class directly, which is yours free with the .NET Framework....
 
 
 
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_ConfigurationResetEvent);

 

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.

------=_Part_4346_21574968.1193349611795--