Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 61829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:22:49+00:00 2026-05-10T18:22:49+00:00

I decided to use log4net as a logger for a new webservice project. Everything

  • 0

I decided to use log4net 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 web.config:

Could not find schema information for the element ‘log4net’…

Below are the relevant parts of my web.config:

  <configSections>     <section name='log4net'          type='log4net.Config.Log4NetConfigurationSectionHandler, log4net' />   </configSections>   <log4net>     <appender name='RollingFileAppender' type='log4net.Appender.RollingFileAppender'>       <file value='C:\log.txt' />       <appendToFile value='true' />       <rollingStyle value='Size' />       <maxSizeRollBackups value='10' />       <maximumFileSize value='100KB' />       <staticLogFileName value='true' />       <layout type='log4net.Layout.PatternLayout'>         <conversionPattern value='%date [%thread] %-5level: %message%newline' />       </layout>     </appender>     <logger name='TIMServerLog'>       <level value='DEBUG' />       <appender-ref ref='RollingFileAppender' />     </logger>   </log4net> 

Solved:

  1. Copy every log4net specific tag to a separate xml-file. Make sure to use .xml as file extension.
  2. Add the following line to AssemblyInfo.cs:
[assembly: log4net.Config.XmlConfigurator(ConfigFile = 'xmlFile.xml', Watch = true)] 

nemo added:

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.


@wcm: I tried using a separate file. I added the following line to AssemblyInfo.cs

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

and put everything dealing with log4net in that file, but I still get the same messages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:22:50+00:00Added an answer on May 10, 2026 at 6:22 pm

    I had a different take, and needed the following syntax:

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

    which differs from xsl’s last post, but made a difference for me. Check out this blog post, it helped me out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to MVC and decided to use it for my newest project.
I am working on a database access layer project and decided to use Linq
I decided to use Log4J logging framework for a new Java project. I am
If I decided to use some javascipt in my website like $('#body').load(URL); or $.get(URL,
We're working on quite big project and decided use GIT for version control. I've
I have decided to use ZF for one of my PHP project. But I
So I decided to use jquery blinds as my new photo gallery for my
For a project I decided to use Dynamic Data Display to generate charts (more
We decided to use mongodb for some web application (instead of mysql) but want
I have decided to use Netbeans and Mercurial for my latest project (after no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.