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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:30:38+00:00 2026-06-04T06:30:38+00:00

I am using log4net for the first time and have followed the documentation using

  • 0

I am using log4net for the first time and have followed the documentation using supplied configuration samples, however debug statements do not log.

Info, Error, Warn and Fatal levels all log correctly. Can anyone tell me what I am missing?

app.config:

<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

<log4net>
    <appender name="Console" type="log4net.Appender.ColoredConsoleAppender">

        <mapping>
            <level value="INFO" />
            <foreColor value="Green"/>
        </mapping>

        <mapping>
            <level value="DEBUG" />
            <foreColor value="Cyan,HighIntensity"/>
        </mapping>

        <mapping>
            <level value="WARN" />
            <foreColor value="Purple,HighIntensity"/>
        </mapping>

        <mapping>
            <level value="ERROR" />
            <foreColor value="Red,HighIntensity"/>
        </mapping>

        <mapping>
            <level value="FATAL" />
            <foreColor value="Yellow,HighIntensity"/>
        </mapping>

        <layout type="log4net.Layout.PatternLayout">
            <!-- Pattern to output the caller's file name and line number -->
            <conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" />
        </layout>            
    </appender>

    <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
        <file value="example.log" />
        <appendToFile value="true" />
        <maximumFileSize value="100KB" />
        <maxSizeRollBackups value="2" />

        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%level %thread %logger - %message%newline" />
        </layout>
    </appender>

    <root>
        <level value="INFO" />
        <appender-ref ref="Console" />
        <appender-ref ref="RollingFile" />
    </root>
</log4net>

Some people have mentioned checking AssemblyInfo for [assembly: log4net.Config.XmlConfigurator()], however there is no difference with or without this line.

Logger is declared like:

private static readonly ILog log = LogManager.GetLogger( typeof( CWD_Netsuite ) );

and is accessed like:

XmlConfigurator.Configure();
log.Debug("Debugging");             //does not get logged
log.Info( "Entering Application" ); //logged to console and log file
log.Debug( "Debug Statement" );     //does not get logged 

log.Error( "Error statement" );     //logged to console and log file
log.Warn( "Warning statement" );    //logged to console and log file
log.Fatal( "Fatal Statement" );     //logged to console and log file
  • 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. Editorial Team
    Editorial Team
    2026-06-04T06:30:39+00:00Added an answer on June 4, 2026 at 6:30 am

    You have a filter set to INFO level in your root category (thus filtering out any messages of DEBUG level):

    <root>
        <level value="INFO" />
        <appender-ref ref="Console" />
        <appender-ref ref="RollingFile" />
    </root>
    

    Change it to

        <level value="DEBUG" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used log4net in winforms before. First time using with a wpf console
I'm using log4Net for my logging. I also have the following set... <log4net debug=true>
I am using log4net for logging my asp.net application. However the log file is
This is my first serious project using NHibernate and I have setup log4net to
I have created a simple scenario using Log4net, but it seems that my log
Using log4net we would like to log all calls to our ASP.NET MVC controller
I am using log4net to log to the console, and the %date conversionPattern value
I'm using log4net to log my web app's progress, using Log4PostSharp to AOP-injectify all
I'm using log4net and I configured my XML file to log into database with
I'm using log4net, and when i log messages my threadID will be duplicated inside

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.