minherz | 1 May 13:38 2007
Picon

RE: 3rd party assembly logging configuration


The subject of using repository is little cloudy for me, even after reading
documentation. If i want to have same hierarchical repository for my library
but starting from different root, then i have to use Repository attribute at
the assembly level of my library. Is it correct?
Do i have to enable internal debugging of log4net in both configuration
files or only in the application's configuration?
After i make use of different repository does the XmlConfigurer attribute in
the assembly level of my library enough to force log4net loading
configuration from the different file?

Thank you.
--

-- 
View this message in context: http://www.nabble.com/3rd-party-assembly-logging-configuration-tf3668813.html#a10267809
Sent from the Log4net - Users mailing list archive at Nabble.com.

nicko | 1 May 14:05 2007
Picon

RE: 3rd party assembly logging configuration

The log4net internal debugging can be enabled by setting an <appSetting>
in the application's config file:

<appSettings>
  <add key="log4net.Internal.Debug" value="true"/>
</appSettings>

This must go into the applications .config file (or if it is a web app
then the Web.config file).

Setting the XmlConfigurator attribute on your assembly should cause it
to load its configuration separately from the main application.

There is an example application that is included in the log4net download
that shows this behaviour.

examples\net\1.0\Repository

This is made up of 3 assemblies.

SharedModule - this is an ordinary DLL, it uses logging, but does not
configure it.
SimpleApp - this is an EXE, it configures and uses logging.
SimpleModule - this is a DLL, that setups its own repository and
configures it.

To see the RepositoryAttribute and XmlConfiguratorAttribute have a look
at this example source file:

examples\net\1.0\Repository\SimpleModule\cs\src\Math.cs
(Continue reading)

minherz | 1 May 15:08 2007
Picon

RE: 3rd party assembly logging configuration


It does not work, though i configured all like in the example.
The internal debugging display that my library has no repository attribute.
I defined it as [assembly:
log4net.Config.Repository("RootNameSpaceOfTheLibrary")]
inside the AssemblyInfo.cs file and before the log4net.Config.XmlConfigurer
attribute.

nicko wrote:
> 
> The log4net internal debugging can be enabled by setting an <appSetting>
> in the application's config file:
> 
> <appSettings>
>   <add key="log4net.Internal.Debug" value="true"/>
> </appSettings>
> 
> This must go into the applications .config file (or if it is a web app
> then the Web.config file).
> 
> 
> Setting the XmlConfigurator attribute on your assembly should cause it
> to load its configuration separately from the main application.
> 
> There is an example application that is included in the log4net download
> that shows this behaviour.
> 
> examples\net\1.0\Repository
> 
> This is made up of 3 assemblies.
(Continue reading)

minherz | 1 May 15:14 2007
Picon

RE: 3rd party assembly logging configuration


Thank you. I still must check it but it seems to be working.
Can you answer me to a question about hierarchy support when using
repository attribute?
Will log4net support the hierarchical loggers within library's configuration
if i setup a repository using the topmost namespace name of the library?

nicko wrote:
> 
> The log4net internal debugging can be enabled by setting an <appSetting>
> in the application's config file:
> 
> <appSettings>
>   <add key="log4net.Internal.Debug" value="true"/>
> </appSettings>
> 
> This must go into the applications .config file (or if it is a web app
> then the Web.config file).
> 
> 
> Setting the XmlConfigurator attribute on your assembly should cause it
> to load its configuration separately from the main application.
> 
> There is an example application that is included in the log4net download
> that shows this behaviour.
> 
> examples\net\1.0\Repository
> 
> This is made up of 3 assemblies.
> 
(Continue reading)

nicko | 1 May 15:20 2007
Picon

RE: 3rd party assembly logging configuration

I'm not exactly sure I understand the question, but log4net supports a
hierarchy of loggers regardless of the RepositoryAttribute, there should
be no change in this behaviour.

The name of the repository does not have to match up to the name of your
assembly or any of your namespaces, it is just used to identify a
repository in the process.

Nicko

------------
Nicko Cadell
log4net development
http://logging.apache.org/log4net

-----Original Message-----
From: minherz [mailto:minherz <at> gmail.com] 
Sent: 01 May 2007 14:15
To: log4net-user <at> logging.apache.org
Subject: RE: 3rd party assembly logging configuration

Thank you. I still must check it but it seems to be working.
Can you answer me to a question about hierarchy support when using
repository attribute?
Will log4net support the hierarchical loggers within library's
configuration
if i setup a repository using the topmost namespace name of the library?

nicko wrote:
> 
(Continue reading)

minherz | 1 May 15:31 2007
Picon

RE: 3rd party assembly logging configuration


I assume that root logger's name is empty string, so any type name used for
logger creation will be treated according to hierarchical rules and
independent from the "main" application.

And thank you again for fast and clear answers.

nicko wrote:
> 
> I'm not exactly sure I understand the question, but log4net supports a
> hierarchy of loggers regardless of the RepositoryAttribute, there should
> be no change in this behaviour.
> 
> The name of the repository does not have to match up to the name of your
> assembly or any of your namespaces, it is just used to identify a
> repository in the process.
> 
> Nicko
> 
> ------------
> Nicko Cadell
> log4net development
> http://logging.apache.org/log4net
> 
> -----Original Message-----
> From: minherz [mailto:minherz <at> gmail.com] 
> Sent: 01 May 2007 14:15
> To: log4net-user <at> logging.apache.org
> Subject: RE: 3rd party assembly logging configuration
> 
(Continue reading)

nicko | 1 May 15:37 2007
Picon

RE: 3rd party assembly logging configuration

The root logger's name is NULL rather than empty, that is why you need
to configure it in the log4net XML config using the <root> element
rather than the <logger name=3D""> element. A logger with empty name
would be a child of the root logger.

The logger hierarchy exists within the repository. If you create your
own repository then it is completely separate to the repository and
logger hierarchy used in the main application.

Cheers,
Nicko

------------
Nicko Cadell
log4net development
http://logging.apache.org/log4net

-----Original Message-----
From: minherz [mailto:minherz <at> gmail.com] 
Sent: 01 May 2007 14:31
To: log4net-user <at> logging.apache.org
Subject: RE: 3rd party assembly logging configuration

I assume that root logger's name is empty string, so any type name used
for
logger creation will be treated according to hierarchical rules and
independent from the "main" application.

And thank you again for fast and clear answers.

(Continue reading)

minherz | 1 May 15:45 2007
Picon

Multiple repositories


Hello. After understanding how i can use Repository attribute for creating
independent logging and checking different scenarios of configuration I
found that i can "apply" the application's configuration to be the 3rd party
library's configuration by adding AliasRepository attribute in the
application's code.
What if i have two 3rd party libraries with different repositories defined
and want them to use the application's configuration file. Can i define more
than one AliasRepository or define a list of alias names for repository?

Thank you.
--

-- 
View this message in context: http://www.nabble.com/Multiple-repositories-tf3675102.html#a10269267
Sent from the Log4net - Users mailing list archive at Nabble.com.

nicko | 1 May 15:48 2007
Picon

RE: Multiple repositories

Yes, you can specify multiple AliasRepository attributes.

------------
Nicko Cadell
log4net development
http://logging.apache.org/log4net

-----Original Message-----
From: minherz [mailto:minherz <at> gmail.com] 
Sent: 01 May 2007 14:46
To: log4net-user <at> logging.apache.org
Subject: Multiple repositories

Hello. After understanding how i can use Repository attribute for
creating
independent logging and checking different scenarios of configuration I
found that i can "apply" the application's configuration to be the 3rd
party
library's configuration by adding AliasRepository attribute in the
application's code.
What if i have two 3rd party libraries with different repositories
defined
and want them to use the application's configuration file. Can i define
more
than one AliasRepository or define a list of alias names for repository?

Thank you.
--

-- 
View this message in context:
http://www.nabble.com/Multiple-repositories-tf3675102.html#a10269267
(Continue reading)

Budamala, Jayakumar | 1 May 15:54 2007

RE: Multiple repositories

Hi Nicko,

I have extended to the log4net , to suite my requirements.
Now I want to write, the unit tests for that library, using external
configuration file.

I want to use Nunit. My question is how to test my dll, with the use of
external ,
Configuration file. Could you point me in the right direction. I don't
want to use app.config

Thanks and regards, 
Jayakumar Budamala 
Citigroup Architecture &  Technology Engineering (CATE)  - EIT
Citigroup Campus 
283, King George Rd 
Warren, NJ - 07059 
Tel : 908-563-3064

-----Original Message-----
From: nicko <at> apache.org [mailto:nicko <at> apache.org] 
Sent: Tuesday, May 01, 2007 9:48 AM
To: Log4NET User
Subject: RE: Multiple repositories

Yes, you can specify multiple AliasRepository attributes.

------------
Nicko Cadell
log4net development
(Continue reading)


Gmane