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" />
        </logger>
 
The ref attribute is ponting to a appender which doesn't exist. In this
case too the log4net.LogManager.GetRepository().Configured property
returns true.

Thanks,
-Amit Makhija

-----Original Message-----
From: Nicko Cadell [mailto:[EMAIL PROTECTED] 
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
application.
http://logging.apache.org/log4net/release/faq.html#reliability

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

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

Nicko

> -----Original Message-----
> From: Makhija, Amit [mailto:[EMAIL PROTECTED]
> Sent: 25 July 2005 15:01
> To: [email protected]
> 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
> 
>  
> 
> 

Reply via email to