Simon, 

You can put your assembly level attributes in any source file, but I
tend to put them in the AssemblyInfo.cs as that has a number of assembly
attributes in it.

Does the application using your class library also use log4net? Or does
it load any other libraries that do?

To understand where log4net is looking for the configuration file you
need to enable internal debug.
http://logging.apache.org/log4net/release/manual/faq.html#internalDebug


Nicko

> -----Original Message-----
> From: mailing [mailto:[EMAIL PROTECTED] 
> Sent: 06 January 2005 21:43
> To: [email protected]
> Subject: log4net can't find config file
> 
> Hi,
> 
> I'm trying to use log4net in a class library, so there's no 
> .config file or global.asax file. Usually I have the 
> following assembly attribute in the global.asax.cs to 
> instruct log4net where to find the config file (named 
> <myassembly>.dll.log4net):
> 
> [assembly: 
> log4net.Config.DOMConfigurator(ConfigFileExtension="log4net", 
> Watch=true)]
> 
> Since there's no global.asax.cs, I have the above assembly 
> attribute in one of the class files in the class library. Is 
> this the wrong place to put it? It doesn't appear that 
> log4net is reading the config file.
> 
> How do I get this to work in a class library like this?
> 
> Simon.
> 

Reply via email to