logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Makhija, Amit" <amakh...@doubleclick.net>
Subject RE: Question
Date Mon, 25 Jul 2005 16:15:08 GMT
Thanks Nicko for a quick reply.
I had a entry in my configuration file as 

	<logger name="Business">
		<level value="INFO" />
		<appender-ref ref="Busine" />
The ref attribute is ponting to a appender which doesn't exist. In this
case too the log4net.LogManager.GetRepository().Configured property
returns true.

-Amit Makhija

-----Original Message-----
From: Nicko Cadell [mailto:nicko@neoworks.com] 
Sent: Monday, July 25, 2005 12:09 PM
To: Log4NET User
Subject: RE: Question

Log4net is designed not to throw any exceptions up into the main

You can test if log4net is configured by checking this property:

bool isConfiguredOk = log4net.LogManager.GetRepository().Configured;


> -----Original Message-----
> From: Makhija, Amit [mailto:amakhija@doubleclick.net]
> Sent: 25 July 2005 15:01
> To: log4net-user@logging.apache.org
> Subject: Question
> Hi,
> I am having a question regarding the initialization of log4net. I am 
> trying to initialize the log4net in the following manner
> XmlConfigurator.ConfigureAndWatch(new FileInfo(fileName))
> Even if I pass an invalid ( not well formed) xml it doesn't throw any 
> exception and doesn't let my application know about it. Even if I pass

> a semantically invalid xml ( say with reference to non existing 
> appender ) to it, it doesn't let my application know that something is

> wrong; it just dumps the output on console. I want my application to 
> know whether log4net is initialized properly or not. How do I go about

> this? Is there some property/method, through which I can check the 
> same?
> Thanks,
> -Amit Makhija

View raw message