logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MFr...@FFTW.COM
Subject Re: log4net within Excel RTD/UDF
Date Wed, 15 Jul 2009 21:16:49 GMT
Brian,

Yes, that is what I meant by manually.

I have not looked at log4net code, but I wonder if the attribute can be 
enhanced to use the different base directories.

Thanks for looking.

Michael



Brian Browning <bwbrowning@gmail.com> 
07/15/2009 05:04 PM
Please respond to
"Log4NET User" <log4net-user@logging.apache.org>


To
Log4NET User <log4net-user@logging.apache.org>
cc

Subject
Re: log4net within Excel RTD/UDF





Hi Michael,

I believe the easiest way to do that is to to call 
XmlConfigurator.Configure with the FileInfo object for your desired file.
Is that what you meant when you said you were manually loading the 
configuration? 
If so, I apologize but I think that may be the best you can do.


On Wed, Jul 15, 2009 at 3:36 PM, <MFranz@fftw.com> wrote:

Hi, 

I am using C# to write an Excel RTD (real-time data) and UDF (user defined 
function) and having trouble figuring out how I can get log4net to 
configure itself.  My understanding is that it uses the 
AppDomain.CurrentDomain.BaseDirectory to look for the configuration file. 
 This is the Excel installation directory.  I however do not install my 
application into that directory and do not put any configuration there. 
 My code is installed into its' own directory which can be found by using 
Assembly.GetExecutingAssembly().CodeBase within my code.  Is there an easy 
way to have log4net use a different directory when searching for the 
configuration file? 

I have had success manually loading the configuration, but this forces me 
to put my loading logic into all of the potential entry points.  I can 
have multiple RTDs and UDFs defined within one assembly.  So I am looking 
for an easy way to have one place to worry about the configuration 
loading. 

thanks 

Michael 

*******************************************************************************
This e-mail message is intended solely for the use of the addressee.
The message may contain information that is privileged and 
confidential.
Disclosure to anyone other than the intended recipient is prohibited.
If you are not the intended recipient, please do not disseminate,
distribute or copy this communication, by e-mail or otherwise. Instead,
please notify us immediately by return e-mail(including the original
message with your reply) and then delete and discard all copies of the
message. We have taken precautions to minimize the risk of transmitting
software viruses but nevertheless advise you to carry out your own
virus checks on any attachment to this message. We accept
no liability for any loss or damage caused by software viruses.
*******************************************************************************
 


Mime
View raw message