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 66637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:08:05+00:00 2026-05-10T19:08:05+00:00

I’m having some trouble getting log4net to work from ASP.NET 3.5. This is the

  • 0

I’m having some trouble getting log4net to work from ASP.NET 3.5. This is the first time I’ve tried to use log4net, I feel like I’m missing a piece of the puzzle.

My project references the log4net assembly, and as far as I can tell, it is being deployed successfully on my server.

My web.config contains the following:

  <configSections>     <section name='log4net'       type='log4net.Config.Log4NetConfigurationSectionHandler       , log4net'       requirePermission='false'/>   </configSections>    <log4net>     <appender name='InfoAppender' type='log4net.Appender.FileAppender'>       <file value='..\..\logs\\InfoLog.html' />       <appendToFile value='true' />       <layout type='log4net.Layout.PatternLayout'>         <conversionPattern           value='%d [%t] %-5p %c [%x] - %m%n' />       </layout>     </appender>     <logger name='_Default'>       <level value='INFO' />       <appender-ref ref='InfoAppender' />     </logger>   </log4net> 

I’m using the following code to test the logger:

using log4net; using log4net.Config;  public partial class _Default : System.Web.UI.Page {     private static readonly ILog log = LogManager.GetLogger('_Default');      protected void Page_Load(object sender, EventArgs e)     {         log.Info('Hello logging world!');     } } 

In my Global.asax, I’m doing the following:

void Application_Start(object sender, EventArgs e)  {     log4net.Config.XmlConfigurator.Configure(); } 

At this point, I can’t think of what else I might be doing wrong. The directory I’m trying to store the log in is writable, and even if I try different directories I get the same result: no file, no logs.

Any suggestions? 🙂


Edit: I’ve tried several different formats for the path & name of the log file, some of which include ‘..\..\InfoLog.html’, ‘InfoLog.html’, ‘logs\InfoLog.html’, etc, just in case someone is wondering if that’s the problem.


Edit: I’ve added the root logger node back into the log4net section, I ommitted that on accident when copying from the samples. The root logger node looks like this:

<root>   <level value='INFO' />   <appender-ref ref='InfoAppender' /> </root> 

Even with it, however, I’m still having no luck.

  • 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-10T19:08:05+00:00Added an answer on May 10, 2026 at 7:08 pm

    The root logger is mandatory I think. I suspect configuration is failing because the root doesn’t exist.

    Another potential problem is that Configure isn’t being pointed to the Web.config.

    Try Configure(Server.MapPath(‘~/web.config’)) instead.

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

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Could you do this? Dictionary<YourEnum, int> dic = new Dictionary<YourEnum,… May 11, 2026 at 3:02 pm
  • added an answer You can use the Core/index function in a given context,… May 11, 2026 at 3:02 pm
  • added an answer If there are just a few permitted values then you… May 11, 2026 at 3:02 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.