[ 
https://issues.apache.org/jira/browse/LOGCXX-331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thorsten Schöning resolved LOGCXX-331.
--------------------------------------

    Resolution: Fixed

I applied the fix to trunk.

> DailyRollingFileAppender should roll if program doesn't run at rolling time
> ---------------------------------------------------------------------------
>
>                 Key: LOGCXX-331
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-331
>             Project: Log4cxx
>          Issue Type: Improvement
>          Components: Appender
>            Reporter: Lukas Rössler
>            Assignee: Curt Arnold
>             Fix For: 0.10.0
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> A DailyRollingFileAppender is only rolling the log file if the program is 
> currently running.
> Example log4cxx.properties:
> log4j.appender.file = org.apache.log4j.DailyRollingFileAppender
> log4j.appender.file.datePattern='.'yyyy-MM-dd
> with this configuration, the log file will only be rolled if the program is 
> running at midnight.
> This behaviour can be changed very easily:
> file: timebasedrollingpolicy.cpp lines 107-111:
> ---------------------------------------------------------------
> apr_time_t n = apr_time_now();
> nextCheck = ((n / APR_USEC_PER_SEC) + 1) * APR_USEC_PER_SEC;
> LogString buf;
> ObjectPtr obj(new Date(n));
> ---------------------------------------------------------------
> changed to:
> ---------------------------------------------------------------
> 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(currentFile.exists(pool) ? 
> currentFile.lastModified(pool) : n));
> ---------------------------------------------------------------
> I don't know if there is a better solution - this one works for me.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to