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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:43:50+00:00 2026-05-10T21:43:50+00:00

I am configure log4net to use a composite RollingFileAppender so that the current file

  • 0

I am configure log4net to use a composite RollingFileAppender so that the current file is always named logfile.log and all subsequent files are named logfile-YYYY.MM.dd.seq.log where seq is the sequence number if a log exceeds a certain size within a single day. Unfortunately, I have had very little success in configuring such a setup.

Edit:

My current configuration is pasted below. It has been updated based on several answers which gets me close enough for my needs. This generates files of the format: logfile_YYYY.MM.dd.log.seq

<log4net>      <root>         <level value='DEBUG' />         <appender-ref ref='RollingFileAppender' />     </root>      <appender name='RollingFileAppender' type='log4net.Appender.RollingFileAppender'>         <file value='logs\\logfile'/>         <staticLogFileName value='false'/>         <appendToFile value='true'/>         <rollingStyle value='Composite'/>         <datePattern value='_yyyy.MM.dd&quot;.log&quot;'/>         <maxSizeRollBackups value='10'/>         <maximumFileSize value='75KB'/>         <layout type='log4net.Layout.PatternLayout'>             <conversionPattern value='%date [%thread] %-5level %logger [%property{NDC}] - %message%newline'/>         </layout>         <filter type='log4net.Filter.LevelRangeFilter'>             <param name='LevelMin' value='DEBUG' />             <param name='LevelMax' value='FATAL' />         </filter>     </appender>  </log4net> 

One interesting note, setting

<staticLogFileName value='false'/> 

to true causes the logger to not write any files.

  • 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-10T21:43:50+00:00Added an answer on May 10, 2026 at 9:43 pm

    We use the following (in Log4J):

    <appender name='roller' class='org.apache.log4j.DailyRollingFileAppender'>     <param name='File' value='Applog.log'/>     <param name='DatePattern' value=''.'yyyy-MM-dd'/>     <layout class='org.apache.log4j.PatternLayout'>         <param name='ConversionPattern' value='[slf5s.start]%d{DATE}[slf5s.DATE]%n%p[slf5s.PRIORITY]%n%x[slf5s.NDC]%n%t[slf5s.THREAD]%n%c[slf5s.CATEGORY]%n%l[slf5s.LOCATION]%n%m[slf5s.MESSAGE]%n%n'/>     </layout> </appender> 

    This gives us Applog.log.yyyy-MM-dd files

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

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • 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 syscolumns holds column metadata. select * from syscolumns where name… May 11, 2026 at 12:32 pm
  • added an answer Add to your master page(s) a meta tag to hold… May 11, 2026 at 12:32 pm
  • added an answer From passwd(4): If a +name entry has a non-null password… May 11, 2026 at 12:32 pm

Related Questions

I am trying to configure Reporting Services 2005SP2 on a machine with SQL 2008
I am trying to configure the website SSL port with the certificate for a
I am trying to configure a network connection using ConfigurationManager.ProcessConfiguration, with the configuration file
I am trying to configure Cruise Control with Nunit for reporting purpose. But I
I am using Log4net for a while now and it's an amazing logging framework,
I am trying to use log4net in an ASP.NET application with Visual Studio 2005.
I'm using log4net to log write log message to a rolling log file. Now
I am trying to find somebody smarter than me to validate some syntax I

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.