How Can I tell where log4net thinks it's getting it's config file from?

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-04T17:50:13Z Indexed on 2010/05/04 18:08 UTC
Read the original article Hit count: 589

Hi, I have the following log from the log4net debug log:

log4net: DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy] log4net: XmlConfigurator: configuring repository [log4net-default-repository] using file [log4net.config] watching for file updates log4net: XmlConfigurator: configuring repository [log4net-default-repository] using file [log4net.config] log4net: XmlConfigurator: configuring repository [log4net-default-repository] using stream log4net:ERROR XmlConfigurator: Error while loading XML configuration System.Xml.XmlException: ' ' is an unexpected token. The expected token is '>'. Line 7, position 184. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2) at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(Int32 pos, String expectedToken1, String expectedToken2) at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at System.Xml.XmlValidatingReaderImpl.Read() at System.Xml.XmlValidatingReader.Read() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at log4net.Config.XmlConfigurator.Configure(ILoggerRepository repository, Stream configStream)

The only problem is, I have no idea where it thinks it's getting this log4net.config file, since in my AssemblyInfo.cs I have defined it to be:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "api4net.config", Watch = true)]

Is there an easy way to determine where log4net is loading this mystical log4net.config that has some xml errors?

© Stack Overflow or respective owner

Related posts about log4net

Related posts about log4netconfiguration