logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: log4net can't find config file
Date Fri, 07 Jan 2005 13:51:57 GMT

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.


> -----Original Message-----
> From: mailing [mailto:mailing@wallis.ca] 
> Sent: 06 January 2005 21:43
> To: log4net-user@logging.apache.org
> 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.

View raw message