Note that there are some explanatory texts on larger screens.

plurals
  1. POLog4Net "Could not find schema information" messages
    primarykey
    data
    text
    <p>I decided to use <a href="http://logging.apache.org/log4net/index.html" rel="nofollow noreferrer">log4net</a> as a logger for a new webservice project. Everything is working fine, but I get a lot of messages like the one below, for every log4net tag I am using in my <code>web.config</code>:</p> <blockquote> <p>Could not find schema information for the element 'log4net'...</p> </blockquote> <p>Below are the relevant parts of my <code>web.config</code>:</p> <pre class="lang-xml prettyprint-override"><code> &lt;configSections&gt; &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&gt; &lt;/configSections&gt; &lt;log4net&gt; &lt;appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"&gt; &lt;file value="C:\log.txt" /&gt; &lt;appendToFile value="true" /&gt; &lt;rollingStyle value="Size" /&gt; &lt;maxSizeRollBackups value="10" /&gt; &lt;maximumFileSize value="100KB" /&gt; &lt;staticLogFileName value="true" /&gt; &lt;layout type="log4net.Layout.PatternLayout"&gt; &lt;conversionPattern value="%date [%thread] %-5level: %message%newline" /&gt; &lt;/layout&gt; &lt;/appender&gt; &lt;logger name="TIMServerLog"&gt; &lt;level value="DEBUG" /&gt; &lt;appender-ref ref="RollingFileAppender" /&gt; &lt;/logger&gt; &lt;/log4net&gt; </code></pre> <p>Solved:</p> <ol> <li>Copy every log4net specific tag to a separate <code>xml</code>-file. Make sure to use <code>.xml</code> as file extension.</li> <li>Add the following line to <code>AssemblyInfo.cs</code>:</li> </ol> <pre class="lang-cs prettyprint-override"><code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = "xmlFile.xml", Watch = true)] </code></pre> <p><a href="https://stackoverflow.com/users/20774/nemo">nemo</a> added:</p> <blockquote> <p>Just a word of warning to anyone follow the advice of the answers in this thread. There is a possible security risk by having the log4net configuration in an xml off the root of the web service, as it will be accessible to anyone by default. Just be advised if your configuration contains sensitive data, you may want to put it else where.</p> </blockquote> <hr> <p>@wcm: I tried using a separate file. I added the following line to <code>AssemblyInfo.cs</code></p> <pre class="lang-cs prettyprint-override"><code>[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] </code></pre> <p>and put everything dealing with log4net in that file, but I still get the same messages.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload