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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:27:10+00:00 2026-05-13T17:27:10+00:00

I am currently building an ASP.Net-MVC Application using log4net for logging, but the logger

  • 0

I am currently building an ASP.Net-MVC Application using log4net for logging, but the logger seems to just stop at random. It will happily log for awhile, and then stop, and then will start again after a period of time. I am not even sure what it is that makes it resume logging. I’m not talking about just a few messages being lost- sometimes it dissappears for a long period of time, such as an hour or so.

Why would it stop and start like this? How should I properly configure this so that it will not randomly stop as it does?

Here is my configuration:

<log4net debug="true">
<appender name="RollingLogFileAppender"
        type="log4net.Appender.RollingFileAppender">

  <file value="..\Logs\\CurrentLog.txt" />
  <appendToFile value="true" />
  <datePattern value="yyyyMMdd" />

  <rollingStyle value="Date" />
  <filter type="log4net.Filter.LevelRangeFilter">
    <acceptOnMatch value="true" />

    <levelMin value="INFO" />
    <levelMax value="FATAL" />
  </filter>

  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern
    value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
  </layout>

</appender>

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

  • 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-05-13T17:27:10+00:00Added an answer on May 13, 2026 at 5:27 pm

    Log4Net will fail silently if something goes wrong and it is unable to write to its appenders. This is actually a good thing, since it means a bit of failed logging won’t bring down an otherwise healthy system, but it can be annoying when something isn’t logging as you expect.

    Your best bet is to turn on log4net’s own internal logging to do some diagnostics and (hopefully) work out why it’s failing.

    So in your app’s config file add:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <appSettings>
            <add key="log4net.Internal.Debug" value="true"/>
        </appSettings>
    </configuration>
    

    which will turn on the internal logging, which gets sent to System.Diagnostics.Trace, so you can add:

    <configuration>
        ...
        <system.diagnostics>
            <trace autoflush="true">
                <listeners>
                    <add 
                        name="textWriterTraceListener" 
                        type="System.Diagnostics.TextWriterTraceListener" 
                        initializeData="C:\tmp\log4net.txt" />
                </listeners>
            </trace>
        </system.diagnostics>
        ...
    </configuration>
    

    to capture this to a file.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The tarfile module gives you access to tarballs. It won't… May 13, 2026 at 7:46 pm
  • Editorial Team
    Editorial Team added an answer Have you tried to modify any of the examples from… May 13, 2026 at 7:46 pm
  • Editorial Team
    Editorial Team added an answer This is what I use. Check out the StylesheetMixin class… May 13, 2026 at 7:46 pm

Related Questions

I am currently building an application using ASP.NET MVC. The data entry pages are
I am looking for some guidance on how to incorporate business rules into an
I apologize if this has been asked before, but I haven't quite found the
I am currently building a very small/simple web application in ASP.NET MVC with ADO.NET
I am currently building a simple ASP.NET MVC site using Linq to Entities. My

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.