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

  • Home
  • SEARCH
  • 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 learned about flashdata and decided to use it to display messages based on
I'm just starting a project and decided to use Spring with Appengine. I'm now
I'm working on using JUnit to test an application. I've decided to use HSQL
Ok so I have decided to use Kaminari for pagination in a rails 3
I am building an asp.net mvc3 application and I have decided to use areas
So far I have been working on Iphone applications which use SOAP service to
After reading a few questions on what Java data type to use for currency/money,
For executing periodical tasks, I looked at Timer and ScheduledThreadPoolExecutor (with a single thread)
I am writing a relatively small and simple Windows Service, and using Moles to
I need to transform HTML into XHTML 1.1. I'm doing it in a Java

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.