Thursday, February 09, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: log4net within Excel RTD/UDF
Prev Next
You are not authorized to post a reply.

Author Messages
MFranz@FFTW.COM

07/15/2009 10:36 PM  

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.
*******************************************************************************

 

Brian Browning

07/15/2009 11:04 PM  
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.

MFranz@FFTW.COM

07/15/2009 11:16 PM  

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

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > log4net within Excel RTD/UDF



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement