You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Lee Chun Kit (JIRA)" <ji...@apache.org> on 2011/04/06 07:38:05 UTC

[jira] [Created] (LOG4NET-291) RollingFileAppender not working correctly when using DatePattern containing >= 1 uppercase character in date format string literal

RollingFileAppender not working correctly when using DatePattern containing >= 1 uppercase character in date format string literal
----------------------------------------------------------------------------------------------------------------------------------

                 Key: LOG4NET-291
                 URL: https://issues.apache.org/jira/browse/LOG4NET-291
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.10, 1.2.9, 1.2.11
         Environment: N.A.
            Reporter: Lee Chun Kit
            Priority: Minor


When using RollingFileAppender with a DatePattern containing at least 1 uppercase character in the form of a string literal, rolling of log files does not take place correctly. This is as "curFileName" is a lowercase string.

To reproduce, see: http://mail-archives.apache.org/mod_mbox/logging-log4net-user/201104.mbox/%3CBANLkTi=LraPg7wijKB583gf7L5YstFeeNA@mail.gmail.com%3E

Suggest change/fix to RollingFileAppender.cs:

1.2.9:
793c793
< 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))
---
> 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture)))

1.2.10
816c816
< 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))
---
> 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture)))

Trunk:
885c885
< 				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo))))
---
> 				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture))))

Work-about:
Don't use uppercase characters in the form of a string literal for RollingFileAppender.DatePattern.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LOG4NET-291) RollingFileAppender not working correctly when using DatePattern containing >= 1 uppercase character in date format string literal

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

Stefan Bodewig updated LOG4NET-291:
-----------------------------------

    Fix Version/s: 1.2 Maintenance Release

> RollingFileAppender not working correctly when using DatePattern containing >= 1 uppercase character in date format string literal
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-291
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-291
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.9, 1.2.10, 1.2.11
>         Environment: N.A.
>            Reporter: Lee Chun Kit
>            Priority: Minor
>              Labels: bug
>             Fix For: 1.2 Maintenance Release
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> When using RollingFileAppender with a DatePattern containing at least 1 uppercase character in the form of a string literal, rolling of log files does not take place correctly. This is as "curFileName" is a lowercase string.
> To reproduce, see: http://mail-archives.apache.org/mod_mbox/logging-log4net-user/201104.mbox/%3CBANLkTi=LraPg7wijKB583gf7L5YstFeeNA@mail.gmail.com%3E
> Suggest change/fix to RollingFileAppender.cs:
> 1.2.9:
> 793c793
> < 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))
> ---
> > 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture)))
> 1.2.10
> 816c816
> < 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))
> ---
> > 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture)))
> Trunk:
> 885c885
> < 				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo))))
> ---
> > 				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture))))
> Work-about:
> Don't use uppercase characters in the form of a string literal for RollingFileAppender.DatePattern.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (LOG4NET-291) RollingFileAppender not working correctly when using DatePattern containing >= 1 uppercase character in date format string literal

Posted by "Roy Chastain (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roy Chastain reassigned LOG4NET-291:
------------------------------------

    Assignee:     (was: Roy Chastain)
    
> RollingFileAppender not working correctly when using DatePattern containing >= 1 uppercase character in date format string literal
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-291
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-291
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.9, 1.2.10, 1.2.11
>         Environment: N.A.
>            Reporter: Lee Chun Kit
>            Priority: Minor
>              Labels: bug
>             Fix For: 1.2 Maintenance Release
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> When using RollingFileAppender with a DatePattern containing at least 1 uppercase character in the form of a string literal, rolling of log files does not take place correctly. This is as "curFileName" is a lowercase string.
> To reproduce, see: http://mail-archives.apache.org/mod_mbox/logging-log4net-user/201104.mbox/%3CBANLkTi=LraPg7wijKB583gf7L5YstFeeNA@mail.gmail.com%3E
> Suggest change/fix to RollingFileAppender.cs:
> 1.2.9:
> 793c793
> < 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))
> ---
> > 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture)))
> 1.2.10
> 816c816
> < 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))
> ---
> > 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture)))
> Trunk:
> 885c885
> < 				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo))))
> ---
> > 				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture))))
> Work-about:
> Don't use uppercase characters in the form of a string literal for RollingFileAppender.DatePattern.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (LOG4NET-291) RollingFileAppender not working correctly when using DatePattern containing >= 1 uppercase character in date format string literal

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

Roy Chastain reassigned LOG4NET-291:
------------------------------------

    Assignee: Roy Chastain

> RollingFileAppender not working correctly when using DatePattern containing >= 1 uppercase character in date format string literal
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-291
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-291
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.9, 1.2.10, 1.2.11
>         Environment: N.A.
>            Reporter: Lee Chun Kit
>            Assignee: Roy Chastain
>            Priority: Minor
>              Labels: bug
>             Fix For: 1.2 Maintenance Release
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> When using RollingFileAppender with a DatePattern containing at least 1 uppercase character in the form of a string literal, rolling of log files does not take place correctly. This is as "curFileName" is a lowercase string.
> To reproduce, see: http://mail-archives.apache.org/mod_mbox/logging-log4net-user/201104.mbox/%3CBANLkTi=LraPg7wijKB583gf7L5YstFeeNA@mail.gmail.com%3E
> Suggest change/fix to RollingFileAppender.cs:
> 1.2.9:
> 793c793
> < 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))
> ---
> > 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture)))
> 1.2.10
> 816c816
> < 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))
> ---
> > 				if (! curFileName.StartsWith(baseFile + m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture)))
> Trunk:
> 885c885
> < 				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo))))
> ---
> > 				if (! curFileName.StartsWith(CombinePath(baseFile, m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo).ToLower(System.Globalization.CultureInfo.InvariantCulture))))
> Work-about:
> Don't use uppercase characters in the form of a string literal for RollingFileAppender.DatePattern.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira