Hi,

I am using the log4net 1.2 framework in my application. I am using the DOMConfigurator.ConfigureAndWatch(FileInfo) to read and monitor an external configuration file. See code below which I us to start my logger.

  Private Sub startLogger()
       Dim sr
       Try
           'Start Application Logger
           DOMConfigurator.ConfigureAndWatch(log4netConfig)
       Catch e As Exception
           sr = New StreamWriter("C:\Log4NetErrorStartLogger.log")
           sr.WriteLine("Exception: " + e.Message())
           sr.Close()
       End Try

However if there is an issue with the config file (if for example I remove a brace from one of the XML tags to throw an parsing exception) then log4net will simply not log anything. But it does not throw an exception to indicate that there is something wrong, should it not catch exceptions thrown by the DOMConfigurator and write it to the stream writer log file as configured as above.

Or is there some issue with my code above. Any help which can shed some light on this issue will be greatly appriciated.

Regards,
Adrian




Reply via email to