Monday, May 21, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: error XmlConfigurator: Failed to parse config file.
Prev Next
You are not authorized to post a reply.

Author Messages
suedeuno

12/03/2008 7:42 PM  


I'm getting this error when running a unit test. It does complete the logging
in spite of this error. I need to resolve this so that the automated build
process does not fail. Any ideas?:

log4net : error XmlConfigurator: Failed to parse config file. Is the
<configSections> specified as: <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net,
Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" />


app.config:
    <configSections>
        <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
    </configSections>

In code:
            log4net.Config.XmlConfigurator.Configure();
            log =
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            log.Error("message);

Freddy Gómez

12/03/2008 10:15 PM  
If you add to the config file the section:

 <appSettings>
    <add key="log4net.Internal.Quiet" value="false" />
  </appSettings>

you will get in the output window of Visual Studio debug information from log4net.

suedeuno

12/04/2008 1:35 AM  


It seems that using the XmlConfigurator attribute in assemblyinfo works with
default .config files but the fluent XmlConfigurator does not. Consequently,
using the fluent configuration with non-default config files works as long
as I have the path correct. Seems strange to me.

One question, does XmlConfigurator have to be called in every project that
will use logging? I created a wrapper aroung log4net and would like to just
call XmlConfigurator within the wrapper class only but that doesn't seem to
work for me. It won't log unless I have XmlConfigurator called in every
project using log4net. Any help would be appreciated. Seems configuring
log4net is not as easy as the few tutorials online seem to claim.

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > error XmlConfigurator: Failed to parse config file.



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement