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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:56:27+00:00 2026-05-26T11:56:27+00:00

Day 1 Program start and works all day. Log is written as expected Day

  • 0

Day 1 Program start and works all day. Log is written as expected

Day 2 Past midnight when first activity for the day happens (a cron in
my case) THAT ACTIVITY is recorded and all data for the Day 1 is lost.
This activity is recorded as Day 1 activity

log4j.rootLogger=DEBUG, R

log4j.appender.R = org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.File = ../log/ooo.log
log4j.appender.R.Append = true
log4j.appender.R.DatePattern = '.'yyyy-MM-dd
log4j.appender.R.layout = org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

Example:

In a ooo.log.2011-10-20 i expect to find activity for 10-20
Instead i see first few seconds of 10-21

I expect behavior , as defined by the specification

‘.’yyyy-MM-dd Rollover at midnight each day. At midnight, on March
8th, 2002, /foo/bar.log will be copied to /foo/bar.log.2002-03-08.
Logging for the 9th day of March will be output to /foo/bar.log until
it is rolled over the next day.

Additionally, take a look at the timestamps. It appears to be random is consistent with the minute mark when my cron is called. Regardless of what it does though, appender’s behavior is not consistent with its’ description.

enter image description here

What’s going on here? Please help me understand and correct.

  • 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-26T11:56:28+00:00Added an answer on May 26, 2026 at 11:56 am

    This may also be a symptom of multiple instances of a program logging to the same file; see more here and in other answers.

    Additionally, take a look at the timestamps. It appears to be random is consistent with the minute mark when my cron is called. Regardless of what it does though, appender’s behavior is not consistent with its’ description.

    True. Rollover does not happen “on the hour”, but with the first logged statement AFTER the rollover time mark (hence your file timestamps). And there is no check if the name of the file to which the rolled over part needs to be renamed is free to use.

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

Sidebar

Related Questions

Hi im learning LISP and well, all day i program php for a living,
My day job includes working to develop a Pascal-like compiler. I've been working all
I've written some really nice, funky libraries for use in LinqToSql. (Some day when
I have a program that needs to start on 1/1/09 and when I start
I'm just learning c++ (first day looking at it since I took a 1
Good day! I have met problem with synchronizing threads. I am writing program which
My program threw a NullPointerException the other day when it tried to use a
I've written a custom C# program that receives about 1MByte/sec of UDP multicast data.
I am working with a case where the client has a 30 hour day.
I want to group TV program information from xmltv listings by day of the

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.