You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Nicko Cadell <ni...@neoworks.com> on 2005/04/16 21:27:19 UTC

RE: Configuration Usage/Behaviour question

You can specify the repository to use for an assembly using an assembly
attribute. This does have to be compiled into the assembly itself.

[assembly: log4net.Config.Repository("Repository Name")]

You can also specify the configuration attribute in the assembly to
locate the configuration for that assembly.

[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension="log4net",
Watch=true)]

There is an example in the log4net download at
examples\net\1.0\Repository. This contains an application (SimpleApp)
that uses 2 assemblies, SharedModule.dll does not utilise a separate
repository, SimpleModule.dll does create a separate repository with
separate configuration.

Nicko

> -----Original Message-----
> From: Joseph Mierwa [mailto:jjmierwa@visionair.com] 
> Sent: 12 April 2005 19:35
> To: Log4NET Dev
> Subject: RE: Configuration Usage/Behaviour question
> 
> Thanks. 
> 
> I assume that associating an assembly to a repository must be 
> done programmatically as opposed to configuration?
> 
> 
> 
> -----Original Message-----
> From: mtraudt@optonline.net [mailto:mtraudt@optonline.net]
> Sent: Monday, April 11, 2005 3:05 PM
> To: log4net-dev@logging.apache.org
> Subject: RE: Configuration Usage/Behaviour question
> 
> > I've got a general question. Am I correct in thinking that 
> if I've got 
> > an application that consists of the exe and several dozen 
> dynamically 
> > used assemblies, I can have each using its own log4net 
> config file to 
> > control the logging specific to that assembly (basically each 
> > assembly/namespace has its own unique logger in this case)?
> 
> If I'm not mistaken, this will work provided that each 
> assembly has it's own named logging repository and provides a 
> mechanism for specifying the config file to use.
> 
> In practice, it's quite common for assemblies to use the 
> default logging logging repository and (in some cases) to 
> assume that logging is configured only via the app/web config.
> 
> 
> 
>