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.
| 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. |
|
|
|
ActiveForums 3.7
|