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 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

Related Questions

I have a log4net file appender configured that all my log files should use:
I'm trying to use log4net with an external config file, but it does not
I am able to write to a log file using log4net and Cassini/IIS dev
I'm trying to use log4net with a RollingFileAppender on IIS 7.5 / Server 2008
Inspired by: NServiceBus.Configure.With().Log4Net(a => a.YourProperty = value); I want to use something similar as
I use Log4Net for logging. When the application starts, I call log4net.Config.XmlConfigurator.Configure(); But this
I'm using log4net for logging (duh!). Using the EventLogAppender, I can configure my application
On my asp webforms app I would do the log4net initialization; log4net.Config.XmlConfigurator.Configure(); on global.asax
I have configured log4Net EventLogAppender for Asp.Net 2.0. However it does not log anything.
I configure Drupal to log in with CAS. After login in CAS, When 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.