Author: tschoening Date: Sun Feb 9 18:24:00 2014 New Revision: 1566341 URL: http://svn.apache.org/r1566341 Log: LOGCXX-331: DailyRollingFileAppender should roll if program doesn't run at rolling time
Modified: incubator/log4cxx/trunk/src/changes/changes.xml incubator/log4cxx/trunk/src/main/cpp/timebasedrollingpolicy.cpp Modified: incubator/log4cxx/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/changes/changes.xml?rev=1566341&r1=1566340&r2=1566341&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/changes/changes.xml (original) +++ incubator/log4cxx/trunk/src/changes/changes.xml Sun Feb 9 18:24:00 2014 @@ -54,6 +54,7 @@ <action issue="LOGCXX-303" type="fix">DOMConfigurator does not set ErrorHandler.</action> <action issue="LOGCXX-304" type="fix">BasicConfigurator::configure results in writer not set warning.</action> <action issue="LOGCXX-317" type="fix">Log4cxx triggers locking inversion which can result in a deadlock.</action> + <action issue="LOGCXX-331" type="fix">DailyRollingFileAppender should roll if program doesn't run at rolling time</action> <action issue="LOGCXX-340" type="fix">Transcoder::encodeCharsetName bungles encoding</action> <action issue="LOGCXX-351" type="fix">Download page does not have link to KEYS file</action> <action issue="LOGCXX-365" type="fix">Unit tests fail on system dates later than 2009-12-31.</action> Modified: incubator/log4cxx/trunk/src/main/cpp/timebasedrollingpolicy.cpp URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/timebasedrollingpolicy.cpp?rev=1566341&r1=1566340&r2=1566341&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/main/cpp/timebasedrollingpolicy.cpp (original) +++ incubator/log4cxx/trunk/src/main/cpp/timebasedrollingpolicy.cpp Sun Feb 9 18:24:00 2014 @@ -107,8 +107,10 @@ RolloverDescriptionPtr TimeBasedRollingP apr_time_t n = apr_time_now(); nextCheck = ((n / APR_USEC_PER_SEC) + 1) * APR_USEC_PER_SEC; + File currentFile(currentActiveFile); + LogString buf; - ObjectPtr obj(new Date(n)); + ObjectPtr obj(new Date(currentFile.exists(pool) ? currentFile.lastModified(pool) : n)); formatFileName(obj, buf, pool); lastFileName = buf;