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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:19:44+00:00 2026-05-16T07:19:44+00:00

I am working on .NET Framework 3.5 using C# in Windows XP as administrator

  • 0

I am working on .NET Framework 3.5 using C# in Windows XP as administrator user, using log4net for .NET Framework 2.0 binary reference.

I had tried What am I missing with log4net – No log file created but it does`t work for me.

I add the following into AssemblyInfo.cs:

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

And created a file “Log4Net.config” as below, however, when I run my console application, cannot find any log file in my project. What do I miss?

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
  </configSections>
  <log4net>

    <!-- 
            log4net documentation http://logging.apache.org/log4net/
            Logging levels in order of increasing priority:
                * ALL
                * DEBUG
                * INFO
                * WARN
                * ERROR
                * FATAL
                * OFF
        -->

    <appender name="DebugLog" type="log4net.Appender.FileAppender">
      <file value="MyLog_debug.log" />
      <appendToFile value="true" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
      <maximumFileSize value="5MB" />
      <filter type="log4net.Filter.LevelRangeFilter">
        <levelMin value="DEBUG" />
        <levelMax value="DEBUG" />
      </filter>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%newline%date %-5level %logger - %message%newline" />
      </layout>
    </appender>

    <appender name="InfoLog" type="log4net.Appender.RollingFileAppender">
      <file value="MyLog_info.log" />
      <appendToFile value="true" />
      <rollingStyle value="Composite" />
      <datePattern value="yyyyMMdd" />
      <maxSizeRollBackups value="7" />
      <maximumFileSize value="5MB" />
      <filter type="log4net.Filter.LevelRangeFilter">
        <levelMin value="INFO" />
        <levelMax value="WARN" />
      </filter>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%newline%date %-5level %logger - %message%newline" />
      </layout>
    </appender>

    <appender name="ErrorLog" type="log4net.Appender.RollingFileAppender">
      <file value="MyLog_error.log" />
      <appendToFile value="true" />
      <rollingStyle value="Composite" />
      <datePattern value="yyyyMMdd" />
      <maxSizeRollBackups value="30" />
      <maximumFileSize value="5MB" />
      <filter type="log4net.Filter.LevelRangeFilter">
        <levelMin value="ERROR" />
        <levelMax value="FATAL" />
      </filter>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%newline%date %-5level %logger - %message%newline" />
      </layout>
    </appender>

    <!-- Set the default logging level and add the active appenders -->
    <root>
      <level value="ALL" />
      <appender-ref ref="DebugLog" />
      <appender-ref ref="InfoLog" />
      <appender-ref ref="ErrorLog" />
    </root>

  </log4net>
</configuration>
  • 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-16T07:19:45+00:00Added an answer on May 16, 2026 at 7:19 am

    Make sure the config file is being copied to the output directory.

    If you’re using Visual Studio, go to the ‘Log4Net.config’ properties, and make sure that the ‘Copy to Output Directory’ is set to ‘Copy always’ or ‘Copy if newer’. Otherwise, just make sure you copy the config file to the output directory.

    Also, log4net.Appender.FileAppender does not have a ‘maximumFileSize’ property, so you’ll want to remove that from your configuration file.

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

Sidebar

Related Questions

I'm working on a Windows CE 5.0 device using the .Net Compact Framework 3.5.
i've started working with ASP.NET MVC and using Entity Framework, concretely with SQLite db,
I am using Authorize.net payment module(AIM) with my cakephp framework. Payment functionality is working
I'm working on an import from a CSV file to my ASP.NET MVC3/C#/Entity Framework
Working in .NET Compact Framework, C#, .Net 3.5, Visual Studio 2008. Targeting Windows Mobile
I'm using Visual Studio 2008, .net Framework 3.5 for a Windows forms client-server app
I need to use linq in C# Windows form application working with .Net Framework
When installing .Net Framework 1.1, the SP1 cannot be installed under Vista. Using Windows
I m working on .net framework 3.0 visual studio 08 and Testing it in
I am working in ASP.net with .Net Framework 2.0 and VS 2008 Team System

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.