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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:42:04+00:00 2026-06-15T11:42:04+00:00

I am using the RollingLogFileAppender and it works great and it’s rolling over into

  • 0

I am using the RollingLogFileAppender and it works great and it’s rolling over into new files. But it’s adding the .1, .2, etc at the very end of the file. So I end up with .log.1, .log.2, etc. So every file technically has a new extension that explorer doesn’t know, so I can’t just double click on a file to open.

How can I get the rolling file appender to insert that index BEFORE the file extension?

What I want is

  • .1.log
  • .2.log

Bonus would be for the current file to always be .0.log, that way they always sort correctly in explorer.

EDIT: added my current config settings

<log4net>
    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
      <file value="App_Data\\Logs\\" />
      <datePattern value="dd.MM.yyyy'.log'" />
      <staticLogFileName value="false" />
      <appendToFile value="true" />
      <rollingStyle value="Composite" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="5MB" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>


    <logger name="File">
      <level value="All" />
      <appender-ref ref="RollingLogFileAppender" />
    </logger>
  </log4net>
  • 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-15T11:42:05+00:00Added an answer on June 15, 2026 at 11:42 am

    You just need to use the PreserveLogFileNameExtension property on the RollingFileAppender.

    See the following questions:

    Log4net appender filename issue

    Log4net RollingFileAppender Size rollingStyle file extension

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

Sidebar

Related Questions

Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using mercurial, I've run into an odd problem where a line from one committer
Using Android TelephonyManager an application can obtain the state of data activity over the
Using NLTK and WordNet , how do I convert simple tense verb into its
Using intellij and maven pom files, how do i debug tests run inside the
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using NSDateComponents I know how to get the day component, but this gives me
Using the new mvc4 now gives us access to use facebook oauth otb. I

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.