logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Psenner" <dpsen...@gmail.com>
Subject RE: Assemblies with loggers which use different config-files
Date Tue, 14 Aug 2012 11:21:52 GMT
You could put something like:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config",
Watch = true)]

into the AssemblyInfo.

Cheers

>-----Original Message-----
>From: Matejka, Volker [mailto:Volker.Matejka@realtech.com]
>Sent: Tuesday, August 14, 2012 9:22 AM
>To: Log4NET User
>Subject: RE: Assemblies with loggers which use different config-files
>
>Hi Dominik,
>
> Thanks for your answer. The problem is: Let's say B is some kind of common
>library that other assemblies also reference, so I cannot change the config
>file name for that assembly (because it would be a code change in the
>logger class).
>
>Probably there is not solution for the problem, like changing the log4net-
>config-file-path for the library via code in the referencing assembly?
>
>Thanks,
>Volker
>
>-----Original Message-----
>From: Dominik Psenner [mailto:dpsenner@gmail.com]
>Sent: Dienstag, 14. August 2012 08:43
>To: 'Log4NET User'
>Subject: RE: Assemblies with loggers which use different config-files
>
>Hi Volker,
>
>> How can I achieve that B also uses the log4net-config-file of A (for
>> definition of levels etc.)?
>
>You could create a configuration file C that contains the definitions you
>need in A and B and reference C in A and B. I.e.:
>
>  C
> / \
>A   B
>
>Literally said:
> A depends C
> B depends C
>
>What you should not do is create a cycle in the dependencies, i.e.:
>
>  A
> / \
> \ /
>  B
>
>Literally said:
> A depends B
> B depends A
>
>Cheers



Mime
View raw message