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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:47:51+00:00 2026-06-15T23:47:51+00:00

This answer implies that logs are kept for 7 days. Is this configurable? This

  • 0

This answer implies that logs are kept for 7 days. Is this configurable?

This Java Ranch Post implies that files are never deleted.

This site also agrees that log files are never removed:

If you are trying to use the Apache Log4J DailyRollingFileAppender for a daily log file, you may need to want to specify the maximum number of files which should be kept. Just like rolling RollingFileAppender supports maxBackupIndex. But the current version of Log4j (Apache log4j 1.2.16) does not provide any mechanism to delete old log files if you are using DailyRollingFileAppender. I tried to make small modifications in the original version of DailyRollingFileAppender to add maxBackupIndex property. So, it would be possible to clean up old log files which may not be required for future usage.

Source

I can’t find an authoritative answer and I don’t want to wait 7 days to see if my logs are deleted.

  • 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-15T23:47:51+00:00Added an answer on June 15, 2026 at 11:47 pm

    See this this post regarding Log4J deletes. In short it appears that dailyRollingFileAppender cannot. But perhaps you might want to look at switching to Logback. It was written by the same guy and can do what your looking for.

    I use the following appender to maintain 30 days of HTML logs:

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>Logs\logFile.html</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
          <!-- daily rollover -->
          <fileNamePattern>logFile.%d{yyyy-MM-dd}.html</fileNamePattern>
    
          <!-- keep 30 days' worth of history -->
          <maxHistory>30</maxHistory>
        </rollingPolicy>
    
        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
        <charset>UTF-8</charset>
            <layout class="ch.qos.logback.classic.html.HTMLLayout">
                <pattern>%d{HH:mm:ss.SSS}%thread%level%logger%line%msg</pattern>
            </layout>           
        </encoder>
    </appender>
    

    The relevant sectionfrom the manual states the following on maxHistory:

    The optional maxHistory property controls the maximum number of archive files to keep, deleting older files. For example, if you specify monthly rollover, and set maxHistory to 6, then 6 months worth of archives files will be kept with files older than 6 months deleted. Note as old archived log files are removed, any folders which were created for the purpose of log file archiving will be removed as appropriate.

    Logback also has a Log4J properties translator available here to help with the transistion. As well as an entire chapter in their manual devoted to switching from Log4J.

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

Sidebar

Related Questions

Why does this code return false? This question/answer strongly implies that it should return
in this answer he said that i can use RIA services while creating my
In this question the answer was to flip on a switch that is picked
I'm assuming the answer to this question is that it's impossible, but I'm asking
This answer implies I can use getattr on an xmlrpc server proxy. However, in
This answer has helped me largely but hasn't fully resolved my issues. I'm using
This answer says: Vim's undo/redo system is unbeatable. Type something, undo, type something else,
This answer had me slightly confused. What is a 'select to a temp table'
This answer suggested i should put my data in JS instead of a textarea.
This answer seems to show how to make a JSONObject. NSString *jsonString = @[{\id\:

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.