[logback-dev] [JIRA] Commented: (LBCORE-214) Error in FileNamePatter::toRegex

Derek Libby (JIRA) noreply-jira at qos.ch
Mon Jul 18 22:28:51 CEST 2011


    [ http://jira.qos.ch/browse/LBCORE-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12063#action_12063 ] 

Derek Libby commented on LBCORE-214:
------------------------------------

As documented, users of the TimeBasedRollingPolicy would probably never encounter this bug as the fileNamePattern property controls both the time at which the roll should happen and how the rolled file should be named.  We wrote a policy that separates the roll pattern from the rename pattern and thus allows users to avail themselves of the full power of the SimpleDateFormat class.

Our policy made use of the FileNamePattern class, and yes the manifestation of this bug that we say is a failure to clean up old logs.

I created a git-pull request containing a fix for this bug which handles only the very simplest case of a single embedded single quote in a date formatting string.  I doubt any more than that is necessary. 

> Error in FileNamePatter::toRegex
> --------------------------------
>
>                 Key: LBCORE-214
>                 URL: http://jira.qos.ch/browse/LBCORE-214
>             Project: logback-core
>          Issue Type: Bug
>    Affects Versions: 0.9.24
>         Environment: Linux
>            Reporter: Derek Libby
>            Assignee: Ceki Gulcu
>
> Using a file name pattern of the form:
>     roll.log.%d{yyyy-MM-dd'T'HH:mm:ss}.gz
> results in a regular expression of:
>     roll.log.\\d{4}-\\d{2}-\\d{2}'T'\\d{2}:\\d{2}:\\d{2}.gz
> which has the unfortunate property that it does not match the actual file names which get generated:
>     roll.log.2011-07-11T16:42:28.gz

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list