You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "David Johle (JIRA)" <ji...@apache.org> on 2012/11/14 00:06:13 UTC

[jira] [Created] (LOG4J2-116) RollingFileAppender archives have wrong date values

David Johle created LOG4J2-116:
----------------------------------

             Summary: RollingFileAppender archives have wrong date values
                 Key: LOG4J2-116
                 URL: https://issues.apache.org/jira/browse/LOG4J2-116
             Project: Log4j 2
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0-beta2
            Reporter: David Johle


Suppose I have an appender configured like so:

<RollingFile name="test"
             fileName="logs/test"
             filePattern="logs/test.%d{yyyy-MM-dd}">
  <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
  <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</RollingFile>


Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.

I create several logging events today, and as expected they end up in a file named "logs/test"

Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.

What I expect to see after this is:
logs/test
logs/test.2012-11-13

What I actually end up seeing is:
logs/test
logs/test.2012-11-14

So the archived entries of the 13th are in a file name maching the 14th.  That is quite confusing!


I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always "1 higher" than expected.

I traced through the code, and the culprit seems to be in PatternProcessor:

    protected final void formatFileName(final Object obj, final StringBuilder buf) {
        Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
        formatFileName(objects, buf);
    }


So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.

In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[jira] [Updated] (LOG4J2-116) RollingFileAppender archives have wrong date values

Posted by "David Johle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4J2-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Johle updated LOG4J2-116:
-------------------------------

    Description: 
Suppose I have an appender configured like so:

<RollingFile name="test"
             fileName="logs/test"
             filePattern="logs/test.%d{yyyy-MM-dd}">
  <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
  <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</RollingFile>


Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.

I create several logging events today, and as expected they end up in a file named "logs/test"

Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.

What I expect to see after this is:
logs/test
logs/test.2012-11-13

What I actually end up seeing is:
logs/test
logs/test.2012-11-14

So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!


I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always higher than expected.

I traced through the code, and the culprit seems to be in PatternProcessor:

    protected final void formatFileName(final Object obj, final StringBuilder buf) {
        Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
        formatFileName(objects, buf);
    }


So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.

In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th, which is what I'd get.


  was:
Suppose I have an appender configured like so:

<RollingFile name="test"
             fileName="logs/test"
             filePattern="logs/test.%d{yyyy-MM-dd}">
  <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
  <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</RollingFile>


Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.

I create several logging events today, and as expected they end up in a file named "logs/test"

Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.

What I expect to see after this is:
logs/test
logs/test.2012-11-13

What I actually end up seeing is:
logs/test
logs/test.2012-11-14

So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!


I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always higher than expected.

I traced through the code, and the culprit seems to be in PatternProcessor:

    protected final void formatFileName(final Object obj, final StringBuilder buf) {
        Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
        formatFileName(objects, buf);
    }


So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.

In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th.


    
> RollingFileAppender archives have wrong date values
> ---------------------------------------------------
>
>                 Key: LOG4J2-116
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-116
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-beta2
>            Reporter: David Johle
>
> Suppose I have an appender configured like so:
> <RollingFile name="test"
>              fileName="logs/test"
>              filePattern="logs/test.%d{yyyy-MM-dd}">
>   <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
>   <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
> </RollingFile>
> Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.
> I create several logging events today, and as expected they end up in a file named "logs/test"
> Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.
> What I expect to see after this is:
> logs/test
> logs/test.2012-11-13
> What I actually end up seeing is:
> logs/test
> logs/test.2012-11-14
> So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!
> I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always higher than expected.
> I traced through the code, and the culprit seems to be in PatternProcessor:
>     protected final void formatFileName(final Object obj, final StringBuilder buf) {
>         Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
>         formatFileName(objects, buf);
>     }
> So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.
> In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th, which is what I'd get.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[jira] [Commented] (LOG4J2-116) RollingFileAppender archives have wrong date values

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4J2-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496907#comment-13496907 ] 

Ralph Goers commented on LOG4J2-116:
------------------------------------

I've actually known about this one for a while and it bothered me to, just not enough to fix it yet. It is annoying so I do intend to fix it. 
                
> RollingFileAppender archives have wrong date values
> ---------------------------------------------------
>
>                 Key: LOG4J2-116
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-116
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-beta2
>            Reporter: David Johle
>
> Suppose I have an appender configured like so:
> <RollingFile name="test"
>              fileName="logs/test"
>              filePattern="logs/test.%d{yyyy-MM-dd}">
>   <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
>   <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
> </RollingFile>
> Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.
> I create several logging events today, and as expected they end up in a file named "logs/test"
> Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.
> What I expect to see after this is:
> logs/test
> logs/test.2012-11-13
> What I actually end up seeing is:
> logs/test
> logs/test.2012-11-14
> So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!
> I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always higher than expected.
> I traced through the code, and the culprit seems to be in PatternProcessor:
>     protected final void formatFileName(final Object obj, final StringBuilder buf) {
>         Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
>         formatFileName(objects, buf);
>     }
> So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.
> In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th, which is what I'd get.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[jira] [Updated] (LOG4J2-116) RollingFileAppender archives have wrong date values

Posted by "David Johle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4J2-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Johle updated LOG4J2-116:
-------------------------------

    Description: 
Suppose I have an appender configured like so:

<RollingFile name="test"
             fileName="logs/test"
             filePattern="logs/test.%d{yyyy-MM-dd}">
  <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
  <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</RollingFile>


Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.

I create several logging events today, and as expected they end up in a file named "logs/test"

Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.

What I expect to see after this is:
logs/test
logs/test.2012-11-13

What I actually end up seeing is:
logs/test
logs/test.2012-11-14

So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!


I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always "1 higher" than expected.

I traced through the code, and the culprit seems to be in PatternProcessor:

    protected final void formatFileName(final Object obj, final StringBuilder buf) {
        Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
        formatFileName(objects, buf);
    }


So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.

In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th.


  was:
Suppose I have an appender configured like so:

<RollingFile name="test"
             fileName="logs/test"
             filePattern="logs/test.%d{yyyy-MM-dd}">
  <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
  <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</RollingFile>


Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.

I create several logging events today, and as expected they end up in a file named "logs/test"

Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.

What I expect to see after this is:
logs/test
logs/test.2012-11-13

What I actually end up seeing is:
logs/test
logs/test.2012-11-14

So the archived entries of the 13th are in a file name maching the 14th.  That is quite confusing!


I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always "1 higher" than expected.

I traced through the code, and the culprit seems to be in PatternProcessor:

    protected final void formatFileName(final Object obj, final StringBuilder buf) {
        Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
        formatFileName(objects, buf);
    }


So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.

In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th.


    
> RollingFileAppender archives have wrong date values
> ---------------------------------------------------
>
>                 Key: LOG4J2-116
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-116
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-beta2
>            Reporter: David Johle
>
> Suppose I have an appender configured like so:
> <RollingFile name="test"
>              fileName="logs/test"
>              filePattern="logs/test.%d{yyyy-MM-dd}">
>   <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
>   <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
> </RollingFile>
> Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.
> I create several logging events today, and as expected they end up in a file named "logs/test"
> Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.
> What I expect to see after this is:
> logs/test
> logs/test.2012-11-13
> What I actually end up seeing is:
> logs/test
> logs/test.2012-11-14
> So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!
> I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always "1 higher" than expected.
> I traced through the code, and the culprit seems to be in PatternProcessor:
>     protected final void formatFileName(final Object obj, final StringBuilder buf) {
>         Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
>         formatFileName(objects, buf);
>     }
> So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.
> In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[jira] [Updated] (LOG4J2-116) RollingFileAppender archives have wrong date values

Posted by "David Johle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4J2-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Johle updated LOG4J2-116:
-------------------------------

    Description: 
Suppose I have an appender configured like so:

<RollingFile name="test"
             fileName="logs/test"
             filePattern="logs/test.%d{yyyy-MM-dd}">
  <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
  <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</RollingFile>


Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.

I create several logging events today, and as expected they end up in a file named "logs/test"

Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.

What I expect to see after this is:
logs/test
logs/test.2012-11-13

What I actually end up seeing is:
logs/test
logs/test.2012-11-14

So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!


I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always higher than expected.

I traced through the code, and the culprit seems to be in PatternProcessor:

    protected final void formatFileName(final Object obj, final StringBuilder buf) {
        Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
        formatFileName(objects, buf);
    }


So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.

In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th.


  was:
Suppose I have an appender configured like so:

<RollingFile name="test"
             fileName="logs/test"
             filePattern="logs/test.%d{yyyy-MM-dd}">
  <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
  <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</RollingFile>


Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.

I create several logging events today, and as expected they end up in a file named "logs/test"

Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.

What I expect to see after this is:
logs/test
logs/test.2012-11-13

What I actually end up seeing is:
logs/test
logs/test.2012-11-14

So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!


I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always "1 higher" than expected.

I traced through the code, and the culprit seems to be in PatternProcessor:

    protected final void formatFileName(final Object obj, final StringBuilder buf) {
        Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
        formatFileName(objects, buf);
    }


So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.

In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th.


    
> RollingFileAppender archives have wrong date values
> ---------------------------------------------------
>
>                 Key: LOG4J2-116
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-116
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-beta2
>            Reporter: David Johle
>
> Suppose I have an appender configured like so:
> <RollingFile name="test"
>              fileName="logs/test"
>              filePattern="logs/test.%d{yyyy-MM-dd}">
>   <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
>   <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
> </RollingFile>
> Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.
> I create several logging events today, and as expected they end up in a file named "logs/test"
> Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.
> What I expect to see after this is:
> logs/test
> logs/test.2012-11-13
> What I actually end up seeing is:
> logs/test
> logs/test.2012-11-14
> So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!
> I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always higher than expected.
> I traced through the code, and the culprit seems to be in PatternProcessor:
>     protected final void formatFileName(final Object obj, final StringBuilder buf) {
>         Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
>         formatFileName(objects, buf);
>     }
> So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.
> In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[jira] [Resolved] (LOG4J2-116) RollingFileAppender archives have wrong date values

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4J2-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers resolved LOG4J2-116.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-beta4
         Assignee: Ralph Goers

Fixed in revision 1411052. Please verify and close.
                
> RollingFileAppender archives have wrong date values
> ---------------------------------------------------
>
>                 Key: LOG4J2-116
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-116
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0-beta2
>            Reporter: David Johle
>            Assignee: Ralph Goers
>             Fix For: 2.0-beta4
>
>
> Suppose I have an appender configured like so:
> <RollingFile name="test"
>              fileName="logs/test"
>              filePattern="logs/test.%d{yyyy-MM-dd}">
>   <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %message%n"/>
>   <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
> </RollingFile>
> Supposed today is 2012-11-13, and thus tomorrow is 2012-11-14.
> I create several logging events today, and as expected they end up in a file named "logs/test"
> Midnight goes by, and it is now the 14th.  Some more logging events occur around 12:01 am.
> What I expect to see after this is:
> logs/test
> logs/test.2012-11-13
> What I actually end up seeing is:
> logs/test
> logs/test.2012-11-14
> So the archived entries of the 13th are in a file name matching the 14th.  That is quite confusing!
> I tested this with some other formats, and it seems that no matter what is the most specific (day, hour, minute, etc.) field, it is always higher than expected.
> I traced through the code, and the culprit seems to be in PatternProcessor:
>     protected final void formatFileName(final Object obj, final StringBuilder buf) {
>         Object[] objects = new Object[] {new Date(System.currentTimeMillis()), obj};
>         formatFileName(objects, buf);
>     }
> So the Date being used for the filename is the current time when the name is computed, which is guaranteed to be within an interval that is after the one of the file contents.  If I went a copule of intervals (in this case days) without log events, then it could be stamped with a name that is several days after the contents.
> In the latter case, I'm not sure if I'd expect to see a filename with the 13th still, or maybe the 15th (assuming rollover happened during the 16th).  But in either case, I definitely don't expect to see a filename with the 16th, which is what I'd get.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org