Thank you Dean for your suggestion.
Now I have figured out how to get there.
Here is these steps:
1.place your separate log4net configuration whatever location take C:\config\log4netcfg.xml for example. 2.my add-in is an assembly which recursively references other assemblies, Now I can programatically configure log4net environment in add-in's default constructor(typically AddInName.Connect) using log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo("C:\\config\\log4netcfg.xml"));
3.then I can use logging function as usual in my add-in assembly.

Thanks again Dean. Hope this can help others.

From: "Dean Fiala" <[EMAIL PROTECTED]>
Reply-To: "Log4NET User" <[email protected]>
To: "'Log4NET User'" <[email protected]>
Subject: RE: utilize logging functionality in my add-in
Date: Tue, 6 Feb 2007 13:10:39 -0500

The only thing that is different is that the context of the library is the
VS2005 executable and not something you have written yourself. It's been a while since I've worked with add-ins, but I imagine that there is a some sort of start up method that is called when the add-in is loaded. What you'd need to here is have the method configure your logging, either programmitically or by using the XmlConfigurator. The trickiest part will be determining the file locations for the configuration and/or output, but either the .NET AppDomain or Environment classes will let you know where the application is working and you can work from there.

HTH,

Dean Fiala

Chief Technology Officer
Celadon Laboratories, Inc.
http://www.celadonlabs.com




-----Original Message-----
From: king kele [mailto:[EMAIL PROTECTED]
Sent: Monday, February 05, 2007 12:00 AM
To: [email protected]
Subject: utilize logging functionality in my add-in

I've used log4net in several project.It's good.
But now, the problem is I want to use log4net for logging in my vs2005
add-in, it's a class library assembly.
Previously, I use log4net in terms of standlone application such as
windows application, asp.net application etc. Now it's an class library.
Anyone can tell me how to use log4net in my add-in for logging?
Thanks in advance.

_________________________________________________________________
���璐逛��杞� MSN Explorer:   http://explorer.msn.com/lccn/





_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn

Reply via email to